From: Vincent Pit Date: Sat, 24 Aug 2013 21:47:21 +0000 (-0300) Subject: Switch qw delimiters to <> X-Git-Url: http://git.vpit.fr/?p=perl%2Fmodules%2FSub-Nary.git;a=commitdiff_plain;h=790ba71f0305951a6d7bb04ca02a1dad7563f439 Switch qw delimiters to <> --- diff --git a/lib/Sub/Nary.pm b/lib/Sub/Nary.pm index ec8ca4d..de42e73 100644 --- a/lib/Sub/Nary.pm +++ b/lib/Sub/Nary.pm @@ -5,9 +5,9 @@ use 5.008_001; use strict; use warnings; -use Carp qw/croak/; +use Carp qw; -use B qw/class ppname svref_2object OPf_KIDS/; +use B qw; =head1 NAME @@ -211,12 +211,12 @@ sub power { my %ops; $ops{$_} = 1 for scalops; -$ops{$_} = 0 for qw/stub nextstate pushmark iter unstack/; -$ops{$_} = 1 for qw/padsv/; -$ops{$_} = 'list' for qw/padav/; -$ops{$_} = 'list' for qw/padhv rv2hv/; -$ops{$_} = 'list' for qw/padany/; -$ops{$_} = 'list' for qw/match entereval readline/; +$ops{$_} = 0 for qw; +$ops{$_} = 1 for qw; +$ops{$_} = 'list' for qw; +$ops{$_} = 'list' for qw; +$ops{$_} = 'list' for qw; +$ops{$_} = 'list' for qw; $ops{each} = { 0 => 0.5, 2 => 0.5 }; $ops{stat} = { 0 => 0.5, 13 => 0.5 }; @@ -225,12 +225,12 @@ $ops{caller} = sub { my @a = caller 0; scalar @a }->(); $ops{localtime} = do { my @a = localtime; scalar @a }; $ops{gmtime} = do { my @a = gmtime; scalar @a }; -$ops{$_} = { 0 => 0.5, 10 => 0.5 } for map "gpw$_", qw/nam uid ent/; -$ops{$_} = { 0 => 0.5, 4 => 0.5 } for map "ggr$_", qw/nam gid ent/; -$ops{$_} = 'list' for qw/ghbyname ghbyaddr ghostent/; -$ops{$_} = { 0 => 0.5, 4 => 0.5 } for qw/gnbyname gnbyaddr gnetent/; -$ops{$_} = { 0 => 0.5, 3 => 0.5 } for qw/gpbyname gpbynumber gprotoent/; -$ops{$_} = { 0 => 0.5, 4 => 0.5 } for qw/gsbyname gsbyport gservent/; +$ops{$_} = { 0 => 0.5, 10 => 0.5 } for map "gpw$_", qw; +$ops{$_} = { 0 => 0.5, 4 => 0.5 } for map "ggr$_", qw; +$ops{$_} = 'list' for qw; +$ops{$_} = { 0 => 0.5, 4 => 0.5 } for qw; +$ops{$_} = { 0 => 0.5, 3 => 0.5 } for qw; +$ops{$_} = { 0 => 0.5, 4 => 0.5 } for qw; sub enter { my ($self, $cv) = @_; @@ -386,8 +386,8 @@ sub pp_entersub { $next = $next->sibling; } $n = name($op) - } while ($op->flags & OPf_KIDS and { map { $_ => 1 } qw/null leave/ }->{$n}); - return 'list', undef unless { map { $_ => 1 } qw/gv refgen/ }->{$n}; + } while ($op->flags & OPf_KIDS and { map { $_ => 1 } qw }->{$n}); + return 'list', undef unless { map { $_ => 1 } qw }->{$n}; local $self->{sub} = 1; my ($rc, $lc) = $self->inspect($op); return $r, scale $c, $lc; diff --git a/samples/cx.pl b/samples/cx.pl index 14cb237..3289c8d 100755 --- a/samples/cx.pl +++ b/samples/cx.pl @@ -3,7 +3,7 @@ use strict; use warnings; -use lib qw{blib/lib blib/arch}; +use lib qw; my $bd; BEGIN { diff --git a/t/02-can.t b/t/02-can.t index 5479691..29164dc 100644 --- a/t/02-can.t +++ b/t/02-can.t @@ -7,6 +7,6 @@ use Test::More tests => 3; require Sub::Nary; -for (qw/new nary flush/) { +for (qw) { ok(Sub::Nary->can($_), 'SN can ' . $_); } diff --git a/t/10-obj.t b/t/10-obj.t index feaecc9..d3ad020 100644 --- a/t/10-obj.t +++ b/t/10-obj.t @@ -21,7 +21,7 @@ is(ref $sn3, 'Sub::Nary', 'SN::new called as a functions returns a Sub::Nary obj my $fake = { }; bless $fake, 'Sub::Nary::Hlagh'; -for (qw/flush/) { +for (qw) { eval "Sub::Nary::$_('Sub::Nary')"; like($@, qr/^First\s+argument/, "SN::$_ isn't a class method"); eval "Sub::Nary::$_(\$fake)"; diff --git a/t/20-return.t b/t/20-return.t index 32f2bc1..99d9954 100644 --- a/t/20-return.t +++ b/t/20-return.t @@ -42,7 +42,7 @@ my @tests = ( [ sub { return %h }, 'list' ], [ sub { return $h{a} }, 1 ], - [ sub { return @h{qw/a b/} }, 2 ], + [ sub { return @h{qw} }, 2 ], [ sub { return @h{@a[1 .. 3]} }, 3 ], [ sub { return @h{@a[$y .. 3]} }, 'list' ], [ sub { return keys %h }, 'list' ], @@ -69,7 +69,7 @@ my @tests = ( [ sub { for ($x, 1, $y) { return 1, 2 } }, 2 ], [ sub { for (@a) { return 1, do { $x } } }, 2 ], [ sub { for (keys %h) { return do { 1 }, do { return @a[0, 2] } } }, 2 ], - [ sub { for my $i (1 .. 4) { return @h{qw/a b/} } }, 2 ], + [ sub { for my $i (1 .. 4) { return @h{qw} } }, 2 ], [ sub { for (my $i; $i < 10; ++$i) { return 1, @a[do{return 2, 3}] } }, 2 ], [ sub { return 1, 2 for 1 .. 4 }, 2 ], diff --git a/t/21-list.t b/t/21-list.t index 4dc492a..7fa217b 100644 --- a/t/21-list.t +++ b/t/21-list.t @@ -33,7 +33,7 @@ my @tests = ( [ sub { %h }, 'list' ], [ sub { $h{a} }, 1 ], - [ sub { @h{qw/a b/} }, 2 ], + [ sub { @h{qw} }, 2 ], [ sub { keys %h }, 'list' ], [ sub { values %h }, 'list' ], diff --git a/t/23-branch.t b/t/23-branch.t index ae04564..fef709d 100644 --- a/t/23-branch.t +++ b/t/23-branch.t @@ -40,7 +40,7 @@ sub ret1234 { } elsif ($h{foo}) { return 3, @a[4, 5]; } elsif (@a) { - return @h{qw/a b c/}, $y + return @h{qw}, $y } } diff --git a/t/24-ops.t b/t/24-ops.t index 3bfe542..f824d1c 100644 --- a/t/24-ops.t +++ b/t/24-ops.t @@ -13,7 +13,7 @@ my ($x, %h); my @tests = ( [ sub { delete $h{foo} }, 1 ], - [ sub { delete @h{qw/foo bar baz/} }, 3 ], + [ sub { delete @h{qw} }, 3 ], [ sub { return <$x> }, 'list' ], diff --git a/t/92-pod-coverage.t b/t/92-pod-coverage.t index 9035e8e..ceebe2c 100644 --- a/t/92-pod-coverage.t +++ b/t/92-pod-coverage.t @@ -12,8 +12,10 @@ load_or_skip_all('Test::Pod::Coverage', '1.08', [ ]); load_or_skip_all('Pod::Coverage', '0.18' ); all_pod_coverage_ok({ also_private => [ - qr/^inspect/, qr/^pp_/, qw/enter/, - qw/tag scalops/, - qw/null zero count scale normalize add combine cumulate power/, - qw/name const_sv gv_or_padgv padval/ + qr/^inspect/, + qr/^pp_/, + qw, + qw, + qw, + qw, ] });