in reply to Indirect access of an array
Use an array of array refs instead (see perllol)
my @as = (\@a_1, \@a_2, \@a_3); print Dumper $as[$n - 1];
Of course you shouldn't construct variables with number postfixes in the first place, put them into @as right away. See for example Why it's stupid to `use a variable as a variable name'.
|
|---|