Hacker News new | ask | show | jobs
by gmfawcett 2517 days ago
Perl 5.001 is really old (25 years or so), and lots has changed since then. v5.10 introduced a barrel-full of new features; other important features like the "use v5.10" syntax for supporting older scripts didn't land until much later (v5.16).

Where I work, a few of our legacy systems are still dependent on ~v5.10, which can be a real pain when trying to port code back to legacy. I agree that the Python versioning problem is perhaps more prominent, but Perl 5 doesn't really get a free pass here.

1 comments

The "use VERSION" syntax is fundamentally much older. It used to strictly just assert a minimum version. It also, pre 5.6, required floating point versions ("use 5.005"). In newer versions of perl, this syntax will also invoke "use feature <stuff new in your version and all versions before>" which allows the use of incompatible new features in its lexical scope. One example is that "use 5.12;" and above will turn on "use strict" in the lexical scope. I fought long and hard for that one. Makes the language strictly better (pun intended).
It strictly does! :) I knew that "use 5.12" implied "use strict" but I didn't know the mechanism, or that it could enable other features as well. That's pretty cool!