From: Vincent Pit Date: Mon, 3 Jan 2011 20:24:38 +0000 (+0100) Subject: Switch to qw<> X-Git-Tag: v0.10~1 X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FLexical-Types.git;a=commitdiff_plain;h=bf1b09f4ab8df1710df549764d511b110c6cb396 Switch to qw<> --- diff --git a/Makefile.PL b/Makefile.PL index c8440d1..1e126e8 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/Lexical/Types.pm b/lib/Lexical/Types.pm index 3593a2b..4bffba8 100644 --- a/lib/Lexical/Types.pm +++ b/lib/Lexical/Types.pm @@ -221,7 +221,7 @@ If you prefer to use constants rather than creating empty packages, you can repl sub import { my $pkg = caller; - for (qw/Str Int/) { + for (qw) { my $type = __PACKAGE__ . '::' . $_; no strict 'refs'; no warnings 'redefine'; diff --git a/t/11-args.t b/t/11-args.t index 26aa4b6..695d6c9 100644 --- a/t/11-args.t +++ b/t/11-args.t @@ -88,7 +88,7 @@ use Test::More tests => 14 + 6; my $expect = qr/^Invalid ARRAY reference/; local $@; eval q[ - use Lexical::Types as => [ qw/a b c/ ]; + use Lexical::Types as => [ qw ]; my LTT $x; ]; like $@, $expect, 'as => array'; @@ -99,7 +99,7 @@ use Test::More tests => 14 + 6; diag 'This will throw two warnings' if $] >= 5.008008 and $] < 5.009; local $@; eval q[ - use Lexical::Types as => sub { qw/a b c/ }; + use Lexical::Types as => sub { qw }; my LTT $x; ]; like $@, $expect, 'as => code, returning three scalars'; diff --git a/t/13-padsv.t b/t/13-padsv.t index ae3cbff..0509260 100644 --- a/t/13-padsv.t +++ b/t/13-padsv.t @@ -3,7 +3,7 @@ use strict; use warnings; -use Config qw/%Config/; +use Config qw<%Config>; use Test::More tests => 4; diff --git a/t/16-scope.t b/t/16-scope.t index 6d78ec1..08fabbb 100644 --- a/t/16-scope.t +++ b/t/16-scope.t @@ -26,7 +26,7 @@ use lib 't/lib'; sub cb3 { push @decls, $_[0]; @_ } { no strict 'refs'; - *{"Int3$_\::TYPEDSCALAR"} = \&Int::TYPEDSCALAR for qw/X Y Z/; + *{"Int3$_\::TYPEDSCALAR"} = \&Int::TYPEDSCALAR for qw; } local $SIG{__WARN__} = sub { push @w, join '', 'warn:', @_ }; eval <<' TESTREQUIRED3'; @@ -42,6 +42,6 @@ use lib 't/lib'; @w = grep !/^warn:Attempt\s+to\s+free\s+unreferenced/, @w if $] <= 5.008003; is $@, '', 'third require test didn\'t croak prematurely'; is_deeply \@w, [ ], 'third require test didn\'t warn'; - is_deeply \@decls, [ map "Int3$_", qw/X Z/ ], + is_deeply \@decls, [ map "Int3$_", qw ], 'third require test propagated in the right scopes'; } diff --git a/t/22-magic.t b/t/22-magic.t index 350cbe1..d0cae1b 100644 --- a/t/22-magic.t +++ b/t/22-magic.t @@ -13,7 +13,7 @@ BEGIN { { package Lexical::Types::Test::Str; - use Variable::Magic qw/wizard cast/; + use Variable::Magic qw; our $wiz; BEGIN { @@ -40,7 +40,8 @@ sub check (&$$;$) { my $want = wantarray; my @ret; { - local @{$got}{qw/get set/}; delete @{$got}{qw/get set/}; + local @{$got}{qw}; + delete @{$got}{qw}; if ($want) { @ret = eval { $test->() }; } elsif (defined $want) { diff --git a/t/23-magic-uvar.t b/t/23-magic-uvar.t index 9d3013b..ce80f2e 100644 --- a/t/23-magic-uvar.t +++ b/t/23-magic-uvar.t @@ -13,7 +13,7 @@ BEGIN { { package Lexical::Types::Test::Ref; - use Variable::Magic qw/wizard cast/; + use Variable::Magic qw; our $wiz; BEGIN { @@ -45,7 +45,8 @@ sub check (&$$;$) { my $want = wantarray; my @ret; { - local @{$got}{qw/fetch store/}; delete @{$got}{qw/fetch store/}; + local @{$got}{qw}; + delete @{$got}{qw}; if ($want) { @ret = eval { $test->() }; } elsif (defined $want) { diff --git a/t/30-threads.t b/t/30-threads.t index 5122dd7..d48fa02 100644 --- a/t/30-threads.t +++ b/t/30-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_LEXICAL_TYPES_TEST_THREADS} ? 1 : !1; diff --git a/t/31-threads-teardown.t b/t/31-threads-teardown.t index 3066182..cd93a50 100644 --- a/t/31-threads-teardown.t +++ b/t/31-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_LEXICAL_TYPES_TEST_THREADS} ? 1 : !1; @@ -55,11 +55,11 @@ SKIP: } use threads; $code = threads->create(sub { - $code = @expected = qw/IntX/; + $code = @expected = qw; eval q{use Lexical::Types as => \&cb; my IntX $x;}; die if $@; return $code; })->join; - $code += @expected = qw/IntZ/; + $code += @expected = qw; eval q{my IntY $y;}; die if $@; eval q{use Lexical::Types as => \&cb; my IntZ $z;}; die if $@; $code += 256 if $code < 0;