Perldoc Search: "$^V" perl-5.20.1

search official POD


3 PODs, 13 LINEs found.
perlvar.pod
311 :     $^V     The revision, version, and subversion of the Perl interpreter, represented as a "version" object.
313 :             This variable first appeared in perl v5.6.0; earlier versions of perl will see an undefined value. Before perl v5.10.0 $^V was represented as a v-string.
315 :             $^V can be used to determine whether the Perl interpreter executing a script is in the right range of versions. For example:
317 :                 warn "Hashes not randomized!\n" if !$^V or $^V lt v5.8.1
319 :             To convert $^V into its string representation use "sprintf()"'s "%vd" conversion:
321 :                 printf "version is v%vd\n", $^V;  # Perl's version
1167 :     $]      See "$^V" for a more modern representation of the Perl version that allows accurate string comparisons.
perlfunc.pod
2903 :         VERSION may be either a numeric argument such as 5.006, which will be compared to $], or a literal of the form v5.6.1, which will be compared to $^V (aka $PERL_VERSION). An exception is raised if VERSION is greater than the version of the current Perl interpreter. Compare with "use", which can do a similar check at compile time.
2920 :                     if ( $version > $^V ) {
2922 :                        croak "Perl $vn required--this is only $^V, stopped";
3722 :               printf "version is v%vd\n", $^V;     # Perl's version
4510 :         In the peculiar "use VERSION" form, VERSION may be either a positive decimal fraction such as 5.006, which will be compared to $], or a v-string of the form v5.6.1, which will be compared to $^V (aka $PERL_VERSION). An exception is raised if VERSION is greater than the version of the current Perl interpreter; Perl will not attempt to parse the rest of the file. Compare with "require", which can do a similar check at run time. Symmetrically, "no VERSION" allows you to specify that you want a version of Perl older than the specified one.
perldata.pod
92 :     A sigil, followed by either a caret and a single POSIX uppercase letter, like $^V or $^W, or a sigil followed by a literal control character matching the "\p{POSIX_Cntrl}" property. Due to a historical oddity, if not running under "use utf8", the 128 extra controls in the "[0x80-0xff]" range may also be used in length one variables. The use of a literal control character is deprecated. Support for this form will be removed in a future version of perl.
<< Back to Perldoc Search