sub isPerl5() { return $] =~ m/^5\./ } sub exampleUse() { if (isPerl5()) { print "This IS Perl 5\n"; } else { print "This is NOT Perl 5\n"; } }
Programming Tips - How I can dynamically tell if I am running Perl 5?
Date: 2008oct20
Language: perl
Keywords: perl5, perl6
Q. How I can dynamically tell if I am running Perl 5?
A. This subroutine does the trick: