From: Vincent Pit Date: Mon, 3 Jan 2011 20:39:55 +0000 (+0100) Subject: Switch to qw<> X-Git-Tag: v0.08~2 X-Git-Url: http://git.vpit.fr/?a=commitdiff_plain;h=3201984d539ab173c11a001792be4294af17a08c;hp=b3ee8fb0443427961f58b2005727cba0ab05e809;p=perl%2Fmodules%2Fautovivification.git Switch to qw<> --- diff --git a/Makefile.PL b/Makefile.PL index 724b7a1..1c5c428 100644 --- a/Makefile.PL +++ b/Makefile.PL @@ -8,7 +8,7 @@ BEGIN { local $@; eval { require Config }; die 'OS unsupported' if $@; - Config->import(qw/%Config/); + Config->import(qw<%Config>); } my @DEFINES; @@ -17,15 +17,15 @@ my %macro; my $is_gcc_34 = 0; print "Checking if this is gcc 3.4 on Windows trying to link against an import library... "; if ($^O eq 'MSWin32' and not grep /^LD[A-Z]*=/, @ARGV) { - my ($libperl, $gccversion) = map $_ || '', @Config{qw/libperl gccversion/}; + my ($libperl, $gccversion) = map $_ || '', @Config{qw}; if ($gccversion =~ /^3\.4\.[0-9]+/ and $libperl =~ s/\.lib$//) { $is_gcc_34 = 1; - my ($lddlflags, $ldflags) = @Config{qw/lddlflags ldflags/}; + my ($lddlflags, $ldflags) = @Config{qw}; $_ ||= '', s/-L(?:".*?"|\S+)//g for $lddlflags, $ldflags; $libperl = "-l$libperl"; my $libdirs = join ' ', map { s/(?}; $macro{LDDLFLAGS} = "$lddlflags $libdirs $libperl"; $macro{LDFLAGS} = "$ldflags $libdirs $libperl"; $macro{PERL_ARCHIVE} = '', diff --git a/lib/autovivification.pm b/lib/autovivification.pm index 3d5ab41..71a566f 100644 --- a/lib/autovivification.pm +++ b/lib/autovivification.pm @@ -132,7 +132,7 @@ Throws an exception when an autovivification is avoided. Each call to C adds the specified features to the ones already in use in the current lexical scope. -When C<@opts> is empty, it defaults to C. +When C<@opts> is empty, it defaults to C<< qw >>. =cut @@ -148,7 +148,7 @@ my %bits = ( sub unimport { shift; my $hint = _detag($^H{+(__PACKAGE__)}) || 0; - @_ = qw/fetch exists delete/ unless @_; + @_ = qw unless @_; $hint |= $bits{$_} for grep exists $bits{$_}, @_; $^H |= 0x00020000; $^H{+(__PACKAGE__)} = _tag($hint); diff --git a/samples/bench.pl b/samples/bench.pl index 28aa263..2e5f038 100644 --- a/samples/bench.pl +++ b/samples/bench.pl @@ -3,7 +3,7 @@ use strict; use warnings; -use Benchmark qw/:hireswallclock cmpthese/; +use Benchmark qw<:hireswallclock cmpthese>; use blib; diff --git a/samples/hash2array.pl b/samples/hash2array.pl index 3cf38fc..d58d205 100644 --- a/samples/hash2array.pl +++ b/samples/hash2array.pl @@ -3,8 +3,8 @@ use strict; use warnings; -use Fatal qw/open close/; -use Text::Balanced qw/extract_bracketed/; +use Fatal qw; +use Text::Balanced qw; open my $hash_t, '<', 't/20-hash.t'; open my $array_t, '>', 't/30-array.t'; diff --git a/t/24-hash-numerous.t b/t/24-hash-numerous.t index 6d489a8..4c559f3 100644 --- a/t/24-hash-numerous.t +++ b/t/24-hash-numerous.t @@ -48,7 +48,7 @@ my $n = 100; { my @r; no autovivification; - @r = @{$x}{qw/a b/} for 1 .. $n; + @r = @{$x}{qw} for 1 .. $n; } is_deeply $x, undef, 'numerous slices from an undef lexical'; @@ -56,7 +56,7 @@ my $n = 100; { my @r; no autovivification; - @r = @{$x->{a}}{qw/b c/} for 1 .. $n; + @r = @{$x->{a}}{qw} for 1 .. $n; } is_deeply $x, { a => undef }, 'numerous slices from a 1-level hashref lexical'; } @@ -66,7 +66,7 @@ my $n = 100; { my @r; no autovivification; - @r = @{$x}{qw/a b/} for 1 .. $n; + @r = @{$x}{qw} for 1 .. $n; } is_deeply $x, undef, 'numerous slices from an undef global'; @@ -74,7 +74,7 @@ my $n = 100; { my @r; no autovivification; - @r = @{$x->{a}}{qw/b c/} for 1 .. $n; + @r = @{$x->{a}}{qw} for 1 .. $n; } is_deeply $x, { a => undef }, 'numerous slices from a 1-level hashref global'; } diff --git a/t/40-scope.t b/t/40-scope.t index 0e3cdec..c79caaf 100644 --- a/t/40-scope.t +++ b/t/40-scope.t @@ -12,7 +12,7 @@ use lib 't/lib'; my $x; my $res = eval { local $SIG{__WARN__} = sub { push @w, join '', 'warn:', @_ }; - no autovivification qw/warn fetch/; + no autovivification qw; $x->{a}; }; is @w, 1, 'warned only once'; diff --git a/t/42-deparse.t b/t/42-deparse.t index 85ad4fc..6b3d1e0 100644 --- a/t/42-deparse.t +++ b/t/42-deparse.t @@ -14,7 +14,7 @@ if (eval 'use B::Deparse; 1') { my $bd = B::Deparse->new; { - no autovivification qw/fetch strict/; + no autovivification qw; sub blech { my $key = $_[0]->{key} } } diff --git a/t/50-threads.t b/t/50-threads.t index 925b8bb..4a01c7c 100644 --- a/t/50-threads.t +++ b/t/50-threads.t @@ -9,7 +9,7 @@ sub skipall { Test::More::plan(skip_all => $msg); } -use Config qw/%Config/; +use Config qw<%Config>; BEGIN { my $force = $ENV{PERL_AUTOVIVIFICATION_TEST_THREADS} ? 1 : !1; diff --git a/t/51-threads-teardown.t b/t/51-threads-teardown.t index d825f91..8cb64f3 100644 --- a/t/51-threads-teardown.t +++ b/t/51-threads-teardown.t @@ -9,7 +9,7 @@ sub skipall { Test::More::plan(skip_all => $msg); } -use Config qw/%Config/; +use Config qw<%Config>; BEGIN { my $force = $ENV{PERL_AUTOVIVIFICATION_TEST_THREADS} ? 1 : !1; diff --git a/t/lib/autovivification/TestRequired4/a0.pm b/t/lib/autovivification/TestRequired4/a0.pm index 317789e..54eaba1 100644 --- a/t/lib/autovivification/TestRequired4/a0.pm +++ b/t/lib/autovivification/TestRequired4/a0.pm @@ -1,5 +1,5 @@ package autovivification::TestRequired4::a0; -no autovivification qw/strict fetch/; +no autovivification qw; use autovivification::TestRequired4::b0; sub error { local $@; diff --git a/t/lib/autovivification/TestRequired5/a0.pm b/t/lib/autovivification/TestRequired5/a0.pm index 5ae1c7b..faa4f30 100644 --- a/t/lib/autovivification/TestRequired5/a0.pm +++ b/t/lib/autovivification/TestRequired5/a0.pm @@ -1,5 +1,5 @@ package autovivification::TestRequired5::a0; -no autovivification qw/strict fetch/; +no autovivification qw; use autovivification::TestRequired5::b0; sub error { local $@;