http://www.perlmonks.org?node_id=777926


in reply to Array reference problem

Why it's stupid to 'use a variable as a variable name'

my @descriptor_array = ( [ 1, 2, 3, 4 ], [ 2, 3, 4, 5 ], [ 3, 4, 5, 6 ], [ 4, 5, 6, 7 ], ); my @insomearray = (0, 3); for my $array_no (@insomearray) { my $array = $descriptor_array[$array_no]; print("$array_no $array @$array\n"); }
0 ARRAY(0x814ec28) 1 2 3 4 3 ARRAY(0x814f8e8) 4 5 6 7