X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=samples%2Fhash2array.pl;h=d703ada917d6faf904b2d1d26472d82f5bb4bfac;hb=HEAD;hp=9fc4a61a773e68d15abae8ad54d3e94b65b0c47e;hpb=c79d4e423275faf328a1cdb9e47fdd1ba432388d;p=perl%2Fmodules%2Fautovivification.git diff --git a/samples/hash2array.pl b/samples/hash2array.pl index 9fc4a61..d703ada 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'; @@ -90,11 +90,11 @@ close $hash_t; close $array_t; close $array_fast_t; -open my $hash_specific_t, '<', 't/22-hash-kv.t'; -open my $array_specific_t, '>', 't/32-array-kv.t'; +open my $hash_kv_t, '<', 't/22-hash-kv.t'; +open my $array_kv_t, '>', 't/32-array-kv.t'; $in_data = 0; -while (<$hash_specific_t>) { +while (<$hash_kv_t>) { if (/^__DATA__$/) { $in_data = 1; } elsif (!$in_data) { @@ -102,10 +102,10 @@ while (<$hash_specific_t>) { if (/\bplan\s*[\s\(]\s*tests\b/) { s/\s*;?\s*$//; s/^(\s*)//; - $_ = "$1if (\$] >= 5.011) { $_ } else { plan skip_all => 'perl 5.11 required for keys/values \@array' }\n"; + $_ = qq($1if ("\$]" >= 5.011) { $_ } else { plan skip_all => 'perl 5.11 required for keys/values \@array' }\n); } } else { $_ = convert_testcase($_, 1); } - print $array_specific_t $_; + print $array_kv_t $_; }