in reply to Don't use 5.6.N

This is especially important if your code has "use warnings;" in it. That's a 5.006ism and gives a poor error message "Cannot find warnings.pm in ..." when the problem is really "You didn't protect against 5.006isms, dumbass!"

For reference, my personal coding template is:

use 5.006; use strict; use warnings FATAL => 'all'; our $VERSION = '0.01'; __END__

Oh, yeah. our is a 5.006ism, too.


My criteria for good software:
  1. Does it work?
  2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?

Replies are listed 'Best First'.
Re^2: Don't use 5.6.N (warnings)
by tye (Sage) on Oct 17, 2007 at 17:10 UTC

    "Can't find warnings.pm..." is a better error message than "Perl 5.006 required", IMHO (much more specific). And I can trivially arrange for code that does "use warnings;" to actually work quite fine on an installation of Perl 5.005, so leaving off "use 5.006" would make the code better in two ways.

    Though some people seem to be offended in some way that some people have reasons for using older versions of Perl and your "dumbass" comment indicates that you are likely one of those.

    - tye        

      The dumbass comment was for the person who threw in "use warnings;" without protecting for it. That's aimed at all those CPAN devs who have "use warnings;" in their tests, but not in their code. Running on older Perls is something I fully respect and understand why it happens - both PDF::Template and Excel::Template run perfectly fine on 5.005_03 and I think they'll run on 5.004 (though that's untested). I also know what I went through to get there.

      As for it being a poor error message - that's from experience. I've gotten a lot of "Why is this breaking on machineX when it works on machineY?" as a consultant. A simple "use 5.006;" would've fixed everything. I view it as documenting assumptions through assertions.


      My criteria for good software:
      1. Does it work?
      2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?