Slash Boxes
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

elliot (8136)

  (email not shown publicly)
AOL IM: elliotshank (Add Buddy, Send Message)

Journal of elliot (8136)

Friday September 07, 2007
05:04 PM

Lesson of the day: Readonly, Exporter, and subroutine sigils

[ #34377 ]

They don't get along.

As of the recent 1.07 release, Perl::Critic, has started using Readonly to be more more self-compliant with Perl Best Practices. We had been avoiding use of constant for the reasons described in the book, but had not been willing to add the Readonly dependency until now.

The Perl::Critic coding standard has been to use sigils for subroutines in @EXPORT_OK, etc. and import lists, but Exporter treats them as optional. And, in fact, there's code that strips them off (line 47 in v5.58). I haven't figured out the commonality, but in a few environments, this fails spectacularly. Once we removed the subroutine sigils from everywhere, the problems have gone.

Explicitness: 0, Keyboard laziness: 1.

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
More | Login | Reply
Loading... please wait.
  • It would be helpful if you explain how to reproduce the failures you have seen. A test script or a short recipe would be nice.
    • This problem was been found on various Linux environments (e.g. []) when testing Perl::Critic; what is common between them other than Linux I haven't identified. Since I don't have a Linux environment currently, I haven't traced down the exact circumstances. Where the failure occurred was not consistent between different environments, so I ended up removing all use of subroutine sigils in Perl::Critic 1.075_001 and this fixed the problem