]> git.vpit.fr Git - perl/modules/autovivification.git/blobdiff - samples/hash2array.pl
Plain dereferencing shouldn't have a different behaviour
[perl/modules/autovivification.git] / samples / hash2array.pl
index 4e7ccaa032da344682be0a7ace71b58c2fdef2c8..863ba885721a1de1c42bc9929d4b51426a34f76b 100644 (file)
@@ -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);