in reply to How to create a new array with the same name as an existing one in a loop?

Ideally you create the array where it is supposed to stay (remember autovivification).
>perl -MData::Dumper -e "my %hash; push @{ $hash{array} }, 1; push @{ +$hash{array} }, 2; print Dumper \%hash;" $VAR1 = { 'array' => [ 1, 2 ] };


holli

You can lead your users to water, but alas, you cannot drown them.
  • Comment on Re: How to create a new array with the same name as an existing one in a loop?
  • Download Code