Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 218
  • Last Modified:

Perl Version


Hello,

Is there a way that a Perl script can determine what version of Perl it is running under?  Without invoking a second instance of Perl of course.

Like a special variable or something?

Cheers,

muff
0
muff
Asked:
muff
1 Solution
 
jmcgOwnerCommented:
$^V or $PERL_VERSION

See "perldoc -f require" as well.
0
 
TintinCommented:
As jmcq mentions, the common way is to use require, eg:

require 5.6.1;  # This script requires a minimum of Perl 5.6.1
0
 
sarajCommented:
Use "Perl -v" to know the current installed Perl Version
0
 
ericl1stCommented:
print $];

That will tell you the perl version, as Perl stores the version in the variable: $]

Cheers!

Eric First
0

Featured Post

Get your problem seen by more experts

Be seen. Boost your question’s priority for more expert views and faster solutions

Tackle projects and never again get stuck behind a technical roadblock.
Join Now