There's more than one way to do things | |
PerlMonks |
Re^2: Why version strings? (uh, no)by tye (Sage) |
on Mar 29, 2011 at 05:33 UTC ( [id://896090]=note: print w/replies, xml ) | Need Help?? |
Even so, it's still a good idea to specify the version number of the Perl language against which you've written any program That's a nice theory. And it sounds so reasonable. It is too bad that the feature isn't actually implemented in a reasonable way for that use case. There is no "I wrote this on 5.10.1 so I can't be sure it will work on other versions" feature. There is only the "I'm damn sure that this will never, ever work on 5.10.0 or before and so any prior version will just tell you 'tough shit' with no real explanation" feature. Since the 'require/use VERSION' feature has become increasingly misused, it would be nice if that feature became pluggable so, for example, an automated smoke test of 5.8.9 could arrange for "require 5.010.001;" (for example) in a module to be non-fatal in a deterministic way so that the module could actually be tested on 5.8.9 and the test results would actually record either "no, this actually works on 5.8.9; shame on the module author" or "one reason this doesn't work on 5.8.9 is that it uses //". It is quite unfortunate that 'use VERSION' doesn't even allow the author to include a reason.
Much better to just roll your own reasonable implementation
Or even avoid the silly version number BS altogether:
Well, at least for cases where the existing diagnostic is worse (like this one):
Or, for chromatic, it would be:
...except that hard-coding v5.14 probably seems unfortunate to him. :) - tye
In Section
Seekers of Perl Wisdom
|
|