Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Why version strings?

by moritz (Cardinal)
on Mar 28, 2011 at 15:38 UTC ( [id://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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others studying the Monastery: (3)
As of 2024-04-19 18:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found