in reply to Re: $^W or require warnings and import warnings;
in thread $^W or require warnings and import warnings;

I guess they're trying to make their code as compatible as possible with perl's before 5.6 and strangely written modules, but it does seem rather cargo-cultish. On a side note: perl 5.6 has been out a long time, so I don't really see the point. Why would someone run something new like Subversion, and not bother to upgrade their ancient Perl? Upgrading parts of your system while other parts are left to rot in legacy mode just seems like trouble.


I think it might be jumping the gun to call that "cargo cult". There are probably lots of corporations out there who don't make upgrading perl a priority. I don't see why (if you had the time) you wouldn't include such a line.
  • Comment on Re^2: $^W or require warnings and import warnings;

Replies are listed 'Best First'.
Re^3: $^W or require warnings and import warnings;
by bluto (Curate) on Jun 15, 2005 at 18:30 UTC
    The problem I have with blindly including something like this is that if you expect a script to work on an ancient version of perl you need to go through hoops to avoid using newer constructs/modules, and more importantly, you really should test your script on those old versions. It's nice to be compatible, but if your script breaks on an ancient version of perl that you "support" you are not doing the poor user any favors. It's actually nicer in the long run to just say "we require 5.6 or newer" and let them install a separate copy of perl if they need to.

    Please note that I'm not saying they are doing this in this particular case, perhaps they have actually tested this on older perls. It just that it seems that way to me at first glance from the posted snippet (which may be assuming too much)...

      That I definitely agree with. If there is any portion of the module that does not support pre-5.6, then it is much better to simply require 5.6 instead.