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

Just create the array in the loop instead of outside the loop.

my %current_main_record; for my $x (qw(foo bar baz)) { my @role_records; # New array. for my $y (qw(zip zap zop)) { push @role_records, $y; } $current_main_record{"role_data"} = \@role_records; }

Seeking work! You can reach me at ikegami@adaelis.com

  • Comment on Re: How to create a new array with the same name as an existing one in a loop?
  • Download Code