in reply to Dereferencing an array of arrays
use strict; identifies your error. Your getting the index of the last element in the array referenced by $array_ref, but $array_ref doesn't exist.
use strict; use warnings; my @array1 = qw(one two three four five); my @array2 = qw(blue green white orange black); my @array3 = qw(car bike plane ship); my @array_of_refs = (\@array1, \@array2, \@array3); print $#array_of_refs; # 2 print $#{ $array_of_refs[2] }; # 3 = $#array3
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Dereferencing an array of arrays
by smist (Acolyte) on Oct 22, 2007 at 17:10 UTC |