Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris

Re: Why version strings?

by moritz (Cardinal)
on Mar 28, 2011 at 15:38 UTC ( #895947=note: print w/replies, xml ) Need Help??

in reply to Why version strings?

Can't Perl detect which version is installed or something?

It's not about the perl version being installed. Once you invoke a perl binary, its version is fixed.

But modern perl versions also have the ability to act like older perls. For example 5.012 has strict implied if you declare that version, but it can also act like an older perl and be non-strict by default.

Now you could argue that the perl binary should autodetect the version of the script, but that's not possible in the general case. A script can be valid in different versions of perl, and produce different output (I've written such a script for educational purposes.

So it could only guess, but guessing is very dangerous. And since Perl cannot be parsed without executing it, autodetection could have dangerous side effects.

Replies are listed 'Best First'.
Re^2: Why version strings?
by Anonymous Monk on Mar 29, 2011 at 00:34 UTC

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://895947]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (4)
As of 2021-05-14 00:24 GMT
Find Nodes?
    Voting Booth?
    Perl 7 will be out ...

    Results (145 votes). Check out past polls.