diff options
author | Nicolas R <atoomic@cpan.org> | 2017-09-12 13:20:25 -0600 |
---|---|---|
committer | Todd Rinaldo <toddr@cpan.org> | 2017-11-11 01:07:18 -0600 |
commit | cc01160e81924fc81416f1a69e0c7c52f7c1bcf7 (patch) | |
tree | acd3b2eb04def6f1aab60612f9a1114100144af4 /lib | |
parent | 1a58b39af83e11fcbeef7ae4cd90c565b1f6b8cb (diff) | |
download | perl-cc01160e81924fc81416f1a69e0c7c52f7c1bcf7.tar.gz |
Replace multiple 'use vars' by 'our' in lib
Using vars pragma is discouraged and has been superseded by 'our' declarations
available in Perl v5.6.0 or later.
This commit is about replacing the usage of 'vars' pragma
by 'our' in 'lib' directory.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Benchmark.t | 2 | ||||
-rw-r--r-- | lib/Config/Extensions.pm | 4 | ||||
-rw-r--r-- | lib/ExtUtils/Embed.pm | 15 | ||||
-rw-r--r-- | lib/ExtUtils/XSSymSet.pm | 3 | ||||
-rw-r--r-- | lib/File/stat.pm | 12 | ||||
-rw-r--r-- | lib/Net/hostent.pm | 11 | ||||
-rw-r--r-- | lib/Net/netent.pm | 8 | ||||
-rw-r--r-- | lib/Net/protoent.pm | 4 | ||||
-rw-r--r-- | lib/Net/servent.pm | 4 | ||||
-rw-r--r-- | lib/Tie/Array.pm | 5 | ||||
-rw-r--r-- | lib/Tie/Scalar.t | 5 | ||||
-rw-r--r-- | lib/Tie/StdHandle.pm | 5 | ||||
-rw-r--r-- | lib/Time/gmtime.pm | 10 | ||||
-rw-r--r-- | lib/Time/localtime.pm | 11 | ||||
-rw-r--r-- | lib/User/grent.pm | 4 | ||||
-rw-r--r-- | lib/User/pwent.pm | 11 | ||||
-rw-r--r-- | lib/blib.pm | 5 |
17 files changed, 69 insertions, 50 deletions
diff --git a/lib/Benchmark.t b/lib/Benchmark.t index 4bf01b222e..523618f576 100644 --- a/lib/Benchmark.t +++ b/lib/Benchmark.t @@ -7,7 +7,7 @@ BEGIN { use warnings; use strict; -use vars qw($foo $bar $baz $ballast); +our ($foo, $bar, $baz, $ballast); use Test::More tests => 213; use Benchmark qw(:all); diff --git a/lib/Config/Extensions.pm b/lib/Config/Extensions.pm index 82fb9e09e8..5c241e97ae 100644 --- a/lib/Config/Extensions.pm +++ b/lib/Config/Extensions.pm @@ -1,10 +1,10 @@ package Config::Extensions; use strict; -use vars qw(%Extensions $VERSION @ISA @EXPORT_OK); +our (%Extensions, $VERSION, @ISA, @EXPORT_OK); use Config; require Exporter; -$VERSION = '0.01'; +$VERSION = '0.02'; @ISA = 'Exporter'; @EXPORT_OK = '%Extensions'; diff --git a/lib/ExtUtils/Embed.pm b/lib/ExtUtils/Embed.pm index b26bf7382e..e75e41f8c4 100644 --- a/lib/ExtUtils/Embed.pm +++ b/lib/ExtUtils/Embed.pm @@ -3,22 +3,19 @@ require Exporter; use Config; require File::Spec; -use vars qw(@ISA @EXPORT $VERSION - @Extensions $Verbose $lib_ext - $opt_o $opt_s - ); +our ( @Extensions, $opt_o, $opt_s ); use strict; # This is not a dual-life module, so no need for development version numbers -$VERSION = '1.34'; +our $VERSION = '1.35'; -@ISA = qw(Exporter); -@EXPORT = qw(&xsinit &ldopts +our @ISA = qw(Exporter); +our @EXPORT = qw(&xsinit &ldopts &ccopts &ccflags &ccdlflags &perl_inc &xsi_header &xsi_protos &xsi_body); -$Verbose = 0; -$lib_ext = $Config{lib_ext} || '.a'; +our $Verbose = 0; +our $lib_ext = $Config{lib_ext} || '.a'; sub is_cmd { $0 eq '-e' } diff --git a/lib/ExtUtils/XSSymSet.pm b/lib/ExtUtils/XSSymSet.pm index 0dee12da92..29192d8702 100644 --- a/lib/ExtUtils/XSSymSet.pm +++ b/lib/ExtUtils/XSSymSet.pm @@ -2,8 +2,7 @@ package ExtUtils::XSSymSet; use strict; use Config; -use vars qw( $VERSION ); -$VERSION = '1.3'; +our $VERSION = '1.4'; sub new { diff --git a/lib/File/stat.pm b/lib/File/stat.pm index b631fbf875..578c3118c8 100644 --- a/lib/File/stat.pm +++ b/lib/File/stat.pm @@ -10,9 +10,16 @@ BEGIN { *warnif = \&warnings::warnif } our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); -our $VERSION = '1.07'; +our $VERSION = '1.08'; + +our @fields; +our ( $st_dev, $st_ino, $st_mode, + $st_nlink, $st_uid, $st_gid, + $st_rdev, $st_size, + $st_atime, $st_mtime, $st_ctime, + $st_blksize, $st_blocks +); -my @fields; BEGIN { use Exporter (); @EXPORT = qw(stat lstat); @@ -25,7 +32,6 @@ BEGIN { @EXPORT_OK = ( @fields, "stat_cando" ); %EXPORT_TAGS = ( FIELDS => [ @fields, @EXPORT ] ); } -use vars @fields; use Fcntl qw(S_IRUSR S_IWUSR S_IXUSR); diff --git a/lib/Net/hostent.pm b/lib/Net/hostent.pm index 3a2fc01387..8831919fb4 100644 --- a/lib/Net/hostent.pm +++ b/lib/Net/hostent.pm @@ -2,8 +2,14 @@ package Net::hostent; use strict; use 5.006_001; -our $VERSION = '1.01'; -our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); +our $VERSION = '1.02'; +our (@EXPORT, @EXPORT_OK, %EXPORT_TAGS); +our ( + $h_name, @h_aliases, + $h_addrtype, $h_length, + @h_addr_list, $h_addr +); + BEGIN { use Exporter (); @EXPORT = qw(gethostbyname gethostbyaddr gethost); @@ -14,7 +20,6 @@ BEGIN { ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); } -use vars @EXPORT_OK; # Class::Struct forbids use of @ISA sub import { goto &Exporter::import } diff --git a/lib/Net/netent.pm b/lib/Net/netent.pm index f7d32cb925..b21c5d11b8 100644 --- a/lib/Net/netent.pm +++ b/lib/Net/netent.pm @@ -2,8 +2,13 @@ package Net::netent; use strict; use 5.006_001; -our $VERSION = '1.00'; +our $VERSION = '1.01'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); +our ( + $n_name, @n_aliases, + $n_addrtype, $n_net +); + BEGIN { use Exporter (); @EXPORT = qw(getnetbyname getnetbyaddr getnet); @@ -13,7 +18,6 @@ BEGIN { ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); } -use vars @EXPORT_OK; # Class::Struct forbids use of @ISA sub import { goto &Exporter::import } diff --git a/lib/Net/protoent.pm b/lib/Net/protoent.pm index 2cbccad3cb..cef20fbd0b 100644 --- a/lib/Net/protoent.pm +++ b/lib/Net/protoent.pm @@ -2,15 +2,15 @@ package Net::protoent; use strict; use 5.006_001; -our $VERSION = '1.00'; +our $VERSION = '1.01'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); +our ( $p_name, @p_aliases, $p_proto ); BEGIN { use Exporter (); @EXPORT = qw(getprotobyname getprotobynumber getprotoent getproto); @EXPORT_OK = qw( $p_name @p_aliases $p_proto ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); } -use vars @EXPORT_OK; # Class::Struct forbids use of @ISA sub import { goto &Exporter::import } diff --git a/lib/Net/servent.pm b/lib/Net/servent.pm index 78a1681455..a3b2bad2c2 100644 --- a/lib/Net/servent.pm +++ b/lib/Net/servent.pm @@ -2,15 +2,15 @@ package Net::servent; use strict; use 5.006_001; -our $VERSION = '1.01'; +our $VERSION = '1.02'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); +our ( $s_name, @s_aliases, $s_port, $s_proto ); BEGIN { use Exporter (); @EXPORT = qw(getservbyname getservbyport getservent getserv); @EXPORT_OK = qw( $s_name @s_aliases $s_port $s_proto ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); } -use vars @EXPORT_OK; # Class::Struct forbids use of @ISA sub import { goto &Exporter::import } diff --git a/lib/Tie/Array.pm b/lib/Tie/Array.pm index e0516a2f30..192983b428 100644 --- a/lib/Tie/Array.pm +++ b/lib/Tie/Array.pm @@ -3,7 +3,7 @@ package Tie::Array; use 5.006_001; use strict; use Carp; -our $VERSION = '1.06'; +our $VERSION = '1.07'; # Pod documentation after __END__ below. @@ -83,8 +83,7 @@ sub DELETE { } package Tie::StdArray; -use vars qw(@ISA); -@ISA = 'Tie::Array'; +our @ISA = 'Tie::Array'; sub TIEARRAY { bless [], $_[0] } sub FETCHSIZE { scalar @{$_[0]} } diff --git a/lib/Tie/Scalar.t b/lib/Tie/Scalar.t index 9be536f8b3..4a6fcfa526 100644 --- a/lib/Tie/Scalar.t +++ b/lib/Tie/Scalar.t @@ -9,14 +9,13 @@ BEGIN { package TieTest; use Tie::Scalar; -use vars qw( @ISA ); -@ISA = qw( Tie::Scalar ); +our @ISA = qw( Tie::Scalar ); sub new { 'Fooled you.' } package main; -use vars qw( $flag ); +our $flag; use Test::More tests => 16; use_ok( 'Tie::Scalar' ); diff --git a/lib/Tie/StdHandle.pm b/lib/Tie/StdHandle.pm index 0c58b706e4..dfb86634f0 100644 --- a/lib/Tie/StdHandle.pm +++ b/lib/Tie/StdHandle.pm @@ -3,9 +3,8 @@ package Tie::StdHandle; use strict; use Tie::Handle; -use vars qw(@ISA $VERSION); -@ISA = 'Tie::Handle'; -$VERSION = '4.4'; +our @ISA = 'Tie::Handle'; +our $VERSION = '4.5'; =head1 NAME diff --git a/lib/Time/gmtime.pm b/lib/Time/gmtime.pm index eb5b371a00..99f470be51 100644 --- a/lib/Time/gmtime.pm +++ b/lib/Time/gmtime.pm @@ -4,7 +4,12 @@ use 5.006_001; use Time::tm; -our(@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); +our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); +our ( $tm_sec, $tm_min, $tm_hour, $tm_mday, + $tm_mon, $tm_year, $tm_wday, $tm_yday, + $tm_isdst, +); + BEGIN { use Exporter (); @ISA = qw(Exporter Time::tm); @@ -15,9 +20,8 @@ BEGIN { $tm_isdst ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); - $VERSION = 1.03; + $VERSION = 1.04; } -use vars @EXPORT_OK; sub populate (@) { return unless @_; diff --git a/lib/Time/localtime.pm b/lib/Time/localtime.pm index c3d9fb3608..f2ef084038 100644 --- a/lib/Time/localtime.pm +++ b/lib/Time/localtime.pm @@ -4,7 +4,13 @@ use 5.006_001; use Time::tm; -our(@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); +our (@ISA, @EXPORT, @EXPORT_OK, %EXPORT_TAGS, $VERSION); +our ( + $tm_sec, $tm_min, $tm_hour, $tm_mday, + $tm_mon, $tm_year, $tm_wday, $tm_yday, + $tm_isdst +); + BEGIN { use Exporter (); @ISA = qw(Exporter Time::tm); @@ -15,9 +21,8 @@ BEGIN { $tm_isdst ); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); - $VERSION = 1.02; + $VERSION = 1.03; } -use vars @EXPORT_OK; sub populate (@) { return unless @_; diff --git a/lib/User/grent.pm b/lib/User/grent.pm index ce6ee5ea44..b66771f2e1 100644 --- a/lib/User/grent.pm +++ b/lib/User/grent.pm @@ -2,15 +2,15 @@ package User::grent; use strict; use 5.006_001; -our $VERSION = '1.01'; +our $VERSION = '1.02'; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); +our ($gr_name, $gr_gid, $gr_passwd, $gr_mem, @gr_members); BEGIN { use Exporter (); @EXPORT = qw(getgrent getgrgid getgrnam getgr); @EXPORT_OK = qw($gr_name $gr_gid $gr_passwd $gr_mem @gr_members); %EXPORT_TAGS = ( FIELDS => [ @EXPORT_OK, @EXPORT ] ); } -use vars @EXPORT_OK; # Class::Struct forbids use of @ISA sub import { goto &Exporter::import } diff --git a/lib/User/pwent.pm b/lib/User/pwent.pm index 91d23bd3f6..3f82e8c861 100644 --- a/lib/User/pwent.pm +++ b/lib/User/pwent.pm @@ -1,7 +1,7 @@ package User::pwent; use 5.006; -our $VERSION = '1.00'; +our $VERSION = '1.01'; use strict; use warnings; @@ -10,6 +10,12 @@ use Config; use Carp; our(@EXPORT, @EXPORT_OK, %EXPORT_TAGS); +our ( $pw_name, $pw_passwd, $pw_uid, $pw_gid, + $pw_gecos, $pw_dir, $pw_shell, + $pw_expire, $pw_change, $pw_class, + $pw_age, + $pw_quota, $pw_comment, + ); BEGIN { use Exporter (); @EXPORT = qw(getpwent getpwuid getpwnam getpw); @@ -21,15 +27,12 @@ BEGIN { $pw_expire $pw_change $pw_class $pw_age $pw_quota $pw_comment - $pw_expire - ); %EXPORT_TAGS = ( FIELDS => [ grep(/^\$pw_/, @EXPORT_OK), @EXPORT ], ALL => [ @EXPORT, @EXPORT_OK ], ); } -use vars grep /^\$pw_/, @EXPORT_OK; # # XXX: these mean somebody hacked this module's source diff --git a/lib/blib.pm b/lib/blib.pm index b3ee3202b1..f8fd500d5e 100644 --- a/lib/blib.pm +++ b/lib/blib.pm @@ -39,9 +39,8 @@ Nick Ing-Simmons nik@tiuk.ti.com use Cwd; use File::Spec; -use vars qw($VERSION $Verbose); -$VERSION = '1.06'; -$Verbose = 0; +our $VERSION = '1.07'; +our $Verbose = 0; sub import { |