X-Git-Url: http://git.vpit.fr/?a=blobdiff_plain;f=samples%2Fhash2array.pl;h=863ba885721a1de1c42bc9929d4b51426a34f76b;hb=7b43fe3caca2977c57aea3f812131d16378cab46;hp=4e7ccaa032da344682be0a7ace71b58c2fdef2c8;hpb=0c37aa6a52c733eb61895b9c95054e5e2f689ede;p=perl%2Fmodules%2Fautovivification.git diff --git a/samples/hash2array.pl b/samples/hash2array.pl index 4e7ccaa..863ba88 100644 --- a/samples/hash2array.pl +++ b/samples/hash2array.pl @@ -40,7 +40,9 @@ while (<$hash_t>) { s{'%'}{'\@'}; print $array_t $_; } else { + s!(\ba\b)?(\s*)HASH\b!($1 ? 'an': '') . "$2ARRAY"!eg; s!->{([a-z])}!'->[' . num($1) . ']'!eg; + s!%(\{?)\$!\@$1\$!g; my $buf; my $suffix = $_; my ($bracket, $prefix);