diff options
51 files changed, 85 insertions, 77 deletions
diff --git a/ext/ByteLoader/bytecode.h b/ext/ByteLoader/bytecode.h index e7ac6c8efd..73f3544294 100644 --- a/ext/ByteLoader/bytecode.h +++ b/ext/ByteLoader/bytecode.h @@ -205,7 +205,7 @@ typedef IV IV64; bset_obj_store(aTHX_ bstate, obj, (I32)ix) : (bstate->bs_obj_list[ix] = obj) /* NOTE: the bytecode header only sanity-checks the bytecode. If a script cares about - * what version of Perl it's being called under, it should do a 'require 5.6.0' or + * what version of Perl it's being called under, it should do a 'use 5.006_001' or * equivalent. However, since the header includes checks requiring an exact match in * ByteLoader versions (we can't guarantee forward compatibility), you don't * need to specify one: diff --git a/ext/Data/Dumper/Dumper.pm b/ext/Data/Dumper/Dumper.pm index 5897e1ffe7..6cf7d35e4d 100644 --- a/ext/Data/Dumper/Dumper.pm +++ b/ext/Data/Dumper/Dumper.pm @@ -13,7 +13,7 @@ $VERSION = '2.103'; #$| = 1; -require 5.6.1; +use 5.006_001; require Exporter; use XSLoader (); require overload; diff --git a/ext/Devel/DProf/DProf.pm b/ext/Devel/DProf/DProf.pm index 6eb4c224f4..d5d8a82a51 100644 --- a/ext/Devel/DProf/DProf.pm +++ b/ext/Devel/DProf/DProf.pm @@ -1,4 +1,4 @@ -require 5.6.1; +use 5.006_001; =head1 NAME diff --git a/ext/IO/lib/IO/Dir.pm b/ext/IO/lib/IO/Dir.pm index d09eb7ff0b..0a083ef9aa 100644 --- a/ext/IO/lib/IO/Dir.pm +++ b/ext/IO/lib/IO/Dir.pm @@ -6,7 +6,7 @@ package IO::Dir; -use 5.6.0; +use 5.006; use strict; use Carp; diff --git a/ext/IO/lib/IO/File.pm b/ext/IO/lib/IO/File.pm index 83699fb55b..240033f304 100644 --- a/ext/IO/lib/IO/File.pm +++ b/ext/IO/lib/IO/File.pm @@ -103,7 +103,7 @@ Derived from FileHandle.pm by Graham Barr E<lt>F<gbarr@pobox.com>E<gt>. =cut -require 5.6.1; +use 5.006_001; use strict; our($VERSION, @EXPORT, @EXPORT_OK, @ISA); use Carp; diff --git a/ext/IO/lib/IO/Handle.pm b/ext/IO/lib/IO/Handle.pm index 37aa99c7bf..6fdba17304 100644 --- a/ext/IO/lib/IO/Handle.pm +++ b/ext/IO/lib/IO/Handle.pm @@ -247,7 +247,7 @@ Derived from FileHandle.pm by Graham Barr E<lt>F<gbarr@pobox.com>E<gt> =cut -require 5.6.1; +use 5.006_001; use strict; our($VERSION, @EXPORT_OK, @ISA); use Carp; diff --git a/ext/IO/lib/IO/Pipe.pm b/ext/IO/lib/IO/Pipe.pm index 27747ce43c..a500f29280 100644 --- a/ext/IO/lib/IO/Pipe.pm +++ b/ext/IO/lib/IO/Pipe.pm @@ -6,7 +6,7 @@ package IO::Pipe; -require 5.6.1; +use 5.006_001; use IO::Handle; use strict; diff --git a/ext/IO/lib/IO/Seekable.pm b/ext/IO/lib/IO/Seekable.pm index 987cbc39d5..684b8bc70d 100644 --- a/ext/IO/lib/IO/Seekable.pm +++ b/ext/IO/lib/IO/Seekable.pm @@ -94,7 +94,7 @@ Derived from FileHandle.pm by Graham Barr E<lt>gbarr@pobox.comE<gt> =cut -require 5.6.1; +use 5.006_001; use Carp; use strict; our($VERSION, @EXPORT, @ISA); diff --git a/ext/Opcode/Opcode.pm b/ext/Opcode/Opcode.pm index 544b2845b7..1524f6762a 100644 --- a/ext/Opcode/Opcode.pm +++ b/ext/Opcode/Opcode.pm @@ -1,6 +1,6 @@ package Opcode; -require 5.6.1; +use 5.006_001; use strict; diff --git a/lib/AnyDBM_File.pm b/lib/AnyDBM_File.pm index 476df473a5..d73abab0f9 100644 --- a/lib/AnyDBM_File.pm +++ b/lib/AnyDBM_File.pm @@ -1,6 +1,6 @@ package AnyDBM_File; -use 5.6.1; +use 5.006_001; our $VERSION = '1.00'; our @ISA = qw(NDBM_File DB_File GDBM_File SDBM_File ODBM_File) unless @ISA; diff --git a/lib/AutoLoader.pm b/lib/AutoLoader.pm index 4e1eb1b064..b42d5ff4b6 100644 --- a/lib/AutoLoader.pm +++ b/lib/AutoLoader.pm @@ -1,6 +1,6 @@ package AutoLoader; -use 5.6.0; +use 5.006_001; our(@EXPORT, @EXPORT_OK, $VERSION); my $is_dosish; diff --git a/lib/AutoSplit.pm b/lib/AutoSplit.pm index 281d5c6ce2..ae119d3d1b 100644 --- a/lib/AutoSplit.pm +++ b/lib/AutoSplit.pm @@ -1,6 +1,6 @@ package AutoSplit; -use 5.6.1; +use 5.006_001; use Exporter (); use Config qw(%Config); use Carp qw(carp); diff --git a/lib/Class/Struct.pm b/lib/Class/Struct.pm index ee231905cf..bad4f78165 100644 --- a/lib/Class/Struct.pm +++ b/lib/Class/Struct.pm @@ -2,7 +2,7 @@ package Class::Struct; ## See POD after __END__ -use 5.6.1; +use 5.006_001; use strict; use warnings::register; diff --git a/lib/Cwd.pm b/lib/Cwd.pm index 8b9a780be0..01f5ce43ea 100644 --- a/lib/Cwd.pm +++ b/lib/Cwd.pm @@ -1,5 +1,5 @@ package Cwd; -require 5.6.0; +use 5.006; =head1 NAME diff --git a/lib/Dumpvalue.pm b/lib/Dumpvalue.pm index 456261a999..427f57cc42 100644 --- a/lib/Dumpvalue.pm +++ b/lib/Dumpvalue.pm @@ -1,4 +1,4 @@ -use 5.6.1; # for (defined ref) and $#$v and our +use 5.006_001; # for (defined ref) and $#$v and our package Dumpvalue; use strict; our $VERSION = '1.00'; diff --git a/lib/ExtUtils/Command.pm b/lib/ExtUtils/Command.pm index b7b41cd7ce..bf1e0e5df8 100644 --- a/lib/ExtUtils/Command.pm +++ b/lib/ExtUtils/Command.pm @@ -1,6 +1,6 @@ package ExtUtils::Command; -use 5.6.1; +use 5.006_001; use strict; # use AutoLoader; use Carp; diff --git a/lib/ExtUtils/Install.pm b/lib/ExtUtils/Install.pm index d70104202a..14a6e08558 100644 --- a/lib/ExtUtils/Install.pm +++ b/lib/ExtUtils/Install.pm @@ -1,6 +1,6 @@ package ExtUtils::Install; -use 5.6.1; +use 5.006_001; our(@ISA, @EXPORT, $VERSION); $VERSION = substr q$Revision: 1.29 $, 10; # $Date: 1998/01/25 07:08:24 $ diff --git a/lib/ExtUtils/Installed.pm b/lib/ExtUtils/Installed.pm index 942185ed87..7433c01dc8 100644 --- a/lib/ExtUtils/Installed.pm +++ b/lib/ExtUtils/Installed.pm @@ -1,6 +1,6 @@ package ExtUtils::Installed; -use 5.6.1; +use 5.006_001; use strict; use Carp qw(); use ExtUtils::Packlist; diff --git a/lib/ExtUtils/Liblist.pm b/lib/ExtUtils/Liblist.pm index ae565fce02..09421e331f 100644 --- a/lib/ExtUtils/Liblist.pm +++ b/lib/ExtUtils/Liblist.pm @@ -21,7 +21,7 @@ package ExtUtils::Liblist::Kid; # This kid package is to be used by MakeMaker. It will not work if # $self is not a Makemaker. -use 5.6.1; +use 5.006_001; # Broken out of MakeMaker from version 4.11 our $VERSION = substr q$Revision: 1.27 $, 10; diff --git a/lib/ExtUtils/Mksymlists.pm b/lib/ExtUtils/Mksymlists.pm index 586113114f..0135cda4f8 100644 --- a/lib/ExtUtils/Mksymlists.pm +++ b/lib/ExtUtils/Mksymlists.pm @@ -1,6 +1,6 @@ package ExtUtils::Mksymlists; -use 5.6.1; +use 5.006_001; use strict qw[ subs refs ]; # no strict 'vars'; # until filehandles are exempted diff --git a/lib/ExtUtils/Packlist.pm b/lib/ExtUtils/Packlist.pm index 7b664d1139..ea4ec5e61f 100644 --- a/lib/ExtUtils/Packlist.pm +++ b/lib/ExtUtils/Packlist.pm @@ -1,6 +1,6 @@ package ExtUtils::Packlist; -use 5.6.1; +use 5.006_001; use strict; use Carp qw(); our $VERSION = '0.04'; diff --git a/lib/Fatal.pm b/lib/Fatal.pm index bf54d9182b..0ea5963df0 100644 --- a/lib/Fatal.pm +++ b/lib/Fatal.pm @@ -1,6 +1,6 @@ package Fatal; -use 5.6.1; +use 5.006_001; use Carp; use strict; our($AUTOLOAD, $Debug, $VERSION); diff --git a/lib/File/Basename.pm b/lib/File/Basename.pm index e16f87187e..c7657881b9 100644 --- a/lib/File/Basename.pm +++ b/lib/File/Basename.pm @@ -135,7 +135,7 @@ BEGIN { -use 5.6.0; +use 5.006; use warnings; our(@ISA, @EXPORT, $VERSION, $Fileparse_fstype, $Fileparse_igncase); require Exporter; diff --git a/lib/File/CheckTree.pm b/lib/File/CheckTree.pm index 35f7906e53..e58e3ecb2c 100644 --- a/lib/File/CheckTree.pm +++ b/lib/File/CheckTree.pm @@ -2,7 +2,7 @@ package File::CheckTree; our $VERSION = '4.1'; -require 5.6.0; +use 5.006; require Exporter; use warnings; diff --git a/lib/File/Compare.pm b/lib/File/Compare.pm index b83ba62583..e1d5e7db91 100644 --- a/lib/File/Compare.pm +++ b/lib/File/Compare.pm @@ -1,6 +1,6 @@ package File::Compare; -use 5.6.0; +use 5.006; use strict; use warnings; our($VERSION, @ISA, @EXPORT, @EXPORT_OK, $Too_Big); diff --git a/lib/File/Copy.pm b/lib/File/Copy.pm index 7daa3ed60d..afb7635f69 100644 --- a/lib/File/Copy.pm +++ b/lib/File/Copy.pm @@ -7,7 +7,7 @@ package File::Copy; -use 5.6.0; +use 5.006; use strict; use warnings; use Carp; diff --git a/lib/File/Find.pm b/lib/File/Find.pm index 1ebfba3184..de0b5340e4 100644 --- a/lib/File/Find.pm +++ b/lib/File/Find.pm @@ -1,7 +1,7 @@ package File::Find; +use 5.006; use strict; use warnings; -use 5.6.0; our $VERSION = '1.02'; require Exporter; require Cwd; diff --git a/lib/File/Path.pm b/lib/File/Path.pm index 7d56d48f28..3560a970a2 100644 --- a/lib/File/Path.pm +++ b/lib/File/Path.pm @@ -91,7 +91,7 @@ Charles Bailey <F<bailey@newman.upenn.edu>> =cut -use 5.6.0; +use 5.006; use Carp; use File::Basename (); use Exporter (); diff --git a/lib/File/stat.pm b/lib/File/stat.pm index aff5d03020..accae9f559 100644 --- a/lib/File/stat.pm +++ b/lib/File/stat.pm @@ -1,8 +1,9 @@ package File::stat; +use 5.006; + use strict; use warnings; -use 5.6.0; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); our $VERSION = '1.00'; diff --git a/lib/FileHandle.pm b/lib/FileHandle.pm index 51c73becb7..6be2242944 100644 --- a/lib/FileHandle.pm +++ b/lib/FileHandle.pm @@ -1,6 +1,6 @@ package FileHandle; -use 5.6.1; +use 5.006; use strict; our($VERSION, @ISA, @EXPORT, @EXPORT_OK); diff --git a/lib/Math/Trig.pm b/lib/Math/Trig.pm index e4732c1d0c..d1ac4f5500 100644 --- a/lib/Math/Trig.pm +++ b/lib/Math/Trig.pm @@ -7,7 +7,7 @@ require Exporter; package Math::Trig; -use 5.6.1; +use 5.006; use strict; use Math::Complex qw(:trig); diff --git a/lib/Net/Ping.pm b/lib/Net/Ping.pm index 8226a97c93..c963a07afd 100644 --- a/lib/Net/Ping.pm +++ b/lib/Net/Ping.pm @@ -12,7 +12,7 @@ package Net::Ping; # Copyright (c) 2001, Colin McMillen. All rights reserved. This # program is free software; you may redistribute it and/or modify it # under the same terms as Perl itself. -use 5.6.1; +use 5.006_001; require Exporter; use strict; diff --git a/lib/Net/hostent.pm b/lib/Net/hostent.pm index 44537a2470..04cbee35a7 100644 --- a/lib/Net/hostent.pm +++ b/lib/Net/hostent.pm @@ -1,7 +1,7 @@ package Net::hostent; use strict; -use 5.6.1; +use 5.006_001; our $VERSION = '1.00'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { diff --git a/lib/Net/netent.pm b/lib/Net/netent.pm index 210da62c50..f7d32cb925 100644 --- a/lib/Net/netent.pm +++ b/lib/Net/netent.pm @@ -1,7 +1,7 @@ package Net::netent; use strict; -use 5.6.1; +use 5.006_001; our $VERSION = '1.00'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { diff --git a/lib/Net/protoent.pm b/lib/Net/protoent.pm index 5bd0b83837..2cbccad3cb 100644 --- a/lib/Net/protoent.pm +++ b/lib/Net/protoent.pm @@ -1,7 +1,7 @@ package Net::protoent; use strict; -use 5.6.1; +use 5.006_001; our $VERSION = '1.00'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { diff --git a/lib/Net/servent.pm b/lib/Net/servent.pm index eaf621a397..63ae3079fe 100644 --- a/lib/Net/servent.pm +++ b/lib/Net/servent.pm @@ -1,7 +1,7 @@ package Net::servent; use strict; -use 5.6.1; +use 5.006_001; our $VERSION = '1.00'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { diff --git a/lib/Shell.pm b/lib/Shell.pm index 5d2f2175d8..9762a3aa0b 100644 --- a/lib/Shell.pm +++ b/lib/Shell.pm @@ -1,5 +1,5 @@ package Shell; -use 5.6.1; +use 5.006_001; use strict; use warnings; our($capture_stderr, $VERSION, $AUTOLOAD); diff --git a/lib/Tie/Array.pm b/lib/Tie/Array.pm index c751d5ba71..1cc99b8980 100644 --- a/lib/Tie/Array.pm +++ b/lib/Tie/Array.pm @@ -1,6 +1,6 @@ package Tie::Array; -use 5.6.1; +use 5.006_001; use strict; use Carp; our $VERSION = '1.02'; diff --git a/lib/Tie/Handle.pm b/lib/Tie/Handle.pm index 8e40589c69..6fd30d8c74 100644 --- a/lib/Tie/Handle.pm +++ b/lib/Tie/Handle.pm @@ -1,6 +1,6 @@ package Tie::Handle; -use 5.6.1; +use 5.006_001; our $VERSION = '4.1'; =head1 NAME diff --git a/lib/Time/Local.pm b/lib/Time/Local.pm index 61805849f8..e99aab1321 100644 --- a/lib/Time/Local.pm +++ b/lib/Time/Local.pm @@ -1,5 +1,5 @@ package Time::Local; -require 5.6.0; +use 5.006; require Exporter; use Carp; use strict; diff --git a/lib/Time/gmtime.pm b/lib/Time/gmtime.pm index 39cfdc2fd7..4e1359b36d 100644 --- a/lib/Time/gmtime.pm +++ b/lib/Time/gmtime.pm @@ -1,8 +1,9 @@ package Time::gmtime; use strict; +use 5.006_001; + use Time::tm; -use 5.6.1; our(@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); BEGIN { use Exporter (); diff --git a/lib/Time/localtime.pm b/lib/Time/localtime.pm index 5495559863..c3d9fb3608 100644 --- a/lib/Time/localtime.pm +++ b/lib/Time/localtime.pm @@ -1,8 +1,9 @@ package Time::localtime; use strict; +use 5.006_001; + use Time::tm; -use 5.6.1; our(@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); BEGIN { use Exporter (); diff --git a/lib/User/grent.pm b/lib/User/grent.pm index e146ec0bb4..d9581d8aa8 100644 --- a/lib/User/grent.pm +++ b/lib/User/grent.pm @@ -1,7 +1,7 @@ package User::grent; use strict; -use 5.6.1; +use 5.006_001; our $VERSION = '1.00'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); BEGIN { diff --git a/lib/base.pm b/lib/base.pm index 00391b46d4..c6d8cca4a7 100644 --- a/lib/base.pm +++ b/lib/base.pm @@ -44,7 +44,7 @@ L<fields> package base; -use 5.6.1; +use 5.006_001; our $VERSION = "1.02"; sub import { diff --git a/lib/diagnostics.pm b/lib/diagnostics.pm index 5d8f4e7c8f..031b08e156 100755 --- a/lib/diagnostics.pm +++ b/lib/diagnostics.pm @@ -168,7 +168,7 @@ Tom Christiansen <F<tchrist@mox.perl.com>>, 25 June 1995. =cut use strict; -use 5.6.0; +use 5.006; use Carp; our $VERSION = 1.1; diff --git a/lib/fields.pm b/lib/fields.pm index 5374848d2a..be2a7aedab 100644 --- a/lib/fields.pm +++ b/lib/fields.pm @@ -127,7 +127,7 @@ L<perlref/Pseudo-hashes: Using an array as a hash> =cut -use 5.6.1; +use 5.006_001; use strict; no strict 'refs'; use warnings::register; diff --git a/lib/vars.pm b/lib/vars.pm index 4abc2d1c08..a051ba128a 100644 --- a/lib/vars.pm +++ b/lib/vars.pm @@ -1,6 +1,6 @@ package vars; -require 5.6.0; +use 5.006; our $VERSION = '1.01'; diff --git a/pod/perl56delta.pod b/pod/perl56delta.pod index fc0d668726..75d7728fda 100644 --- a/pod/perl56delta.pod +++ b/pod/perl56delta.pod @@ -112,16 +112,14 @@ to check if you're running a particular version of Perl: # new features supported } -C<require> and C<use> also have some special magic to support such literals. -They will be interpreted as a version rather than as a module name: - - require v5.6.0; # croak if $^V lt v5.6.0 - use v5.6.0; # same, but croaks at compile-time - -Alternatively, the C<v> may be omitted if there is more than one dot: - - require 5.6.0; - use 5.6.0; +C<require> and C<use> also have some special magic to support such +literals, but this particular usage should be avoided because it leads to +misleading error messages under versions of Perl which don't support vector +strings. Using a true version number will ensure correct behavior in all +versions of Perl: + + require 5.006; # run time check for v5.6 + use 5.006_001; # compile time check for v5.6.1 Also, C<sprintf> and C<printf> support the Perl-specific format flag C<%v> to print ordinals of characters in arbitrary strings: diff --git a/pod/perlfunc.pod b/pod/perlfunc.pod index 0761412f4a..2c198c1d45 100644 --- a/pod/perlfunc.pod +++ b/pod/perlfunc.pod @@ -3755,19 +3755,23 @@ rename(2) manpage or equivalent system documentation for details. =item require -Demands some semantics specified by EXPR, or by C<$_> if EXPR is not -supplied. +Demands a version of Perl specified by VERSION, or demands some semantics +specified by EXPR or by C<$_> if EXPR is not supplied. -If a VERSION is specified as a literal of the form v5.6.1, -demands that the current version of Perl (C<$^V> or $PERL_VERSION) be -at least as recent as that version, at run time. (For compatibility -with older versions of Perl, a numeric argument will also be interpreted -as VERSION.) Compare with L</use>, which can do a similar check at -compile time. +VERSION may be either a numeric argument such as 5.006, which will be +compared to C<$]>, or a literal of the form v5.6.1, which will be compared +to C<$^V> (aka $PERL_VERSION). A fatal error is produced at run time if +VERSION is greater than the version of the current Perl interpreter. +Compare with L</use>, which can do a similar check at compile time. + +Specifying VERSION as a literal of the form v5.6.1 should generally be +avoided, because it leads to misleading error messages under earlier +versions of Perl which do not support this syntax. The equivalent numeric +version should be used instead. require v5.6.1; # run time version check require 5.6.1; # ditto - require 5.005_03; # float version allowed for compatibility + require 5.006_001; # ditto; preferred for backwards compatibility Otherwise, demands that a library file be included if it hasn't already been included. The file is included via the do-FILE mechanism, which is @@ -5640,18 +5644,21 @@ package. It is exactly equivalent to except that Module I<must> be a bareword. -VERSION, which can be specified as a literal of the form v5.6.1, demands -that the current version of Perl (C<$^V> or $PERL_VERSION) be at least -as recent as that version. (For compatibility with older versions of Perl, -a numeric literal will also be interpreted as VERSION.) If the version -of the running Perl interpreter is less than VERSION, then an error -message is printed and Perl exits immediately without attempting to -parse the rest of the file. Compare with L</require>, which can do a -similar check at run time. +VERSION may be either a numeric argument such as 5.006, which will be +compared to C<$]>, or a literal of the form v5.6.1, which will be compared +to C<$^V> (aka $PERL_VERSION. A fatal error is produced 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 L</require>, which can +do a similar check at run time. + +Specifying VERSION as a literal of the form v5.6.1 should generally be +avoided, because it leads to misleading error messages under earlier +versions of Perl which do not support this syntax. The equivalent numeric +version should be used instead. use v5.6.1; # compile time version check use 5.6.1; # ditto - use 5.005_03; # float version allowed for compatibility + use 5.006_001; # ditto; preferred for backwards compatibility This is often useful if you need to check the current Perl version before C<use>ing library modules that have changed in incompatible ways from @@ -3078,7 +3078,7 @@ PP(pp_require) if (sver == 0 && (rev > 5 || (rev == 5 && ver >= 100))) { DIE(aTHX_ "Perl v%"UVuf".%"UVuf".%"UVuf" required--" "this is only v%d.%d.%d, stopped" - " (did you mean v%"UVuf".%"UVuf".0?)", + " (did you mean v%"UVuf".%03"UVuf"?)", rev, ver, sver, PERL_REVISION, PERL_VERSION, PERL_SUBVERSION, rev, ver/100); } diff --git a/utils/pl2pm.PL b/utils/pl2pm.PL index 5637818fa1..d135bc8c45 100644 --- a/utils/pl2pm.PL +++ b/utils/pl2pm.PL @@ -129,7 +129,7 @@ while (<>) { if ( open(PM, ">$newname") ) { print PM <<"END"; package $newpack; -require 5.6.0; +use 5.006; require Exporter; $carp \@ISA = qw(Exporter); |