Kevin Viel wrote:
Consider the following anonymous array of anonymous arrays:
my $a = [ [ 00 , 01 ]
, [ 10 , 11 ]
] ;
I can print the first element of the first anonymous array:
print "$$a[ 0 ][ 0 ]\n" ;
or, equivalently, I can explicit use bracers to dereference it:
print "${$a}[ 0 ][ 0 ]\n" ;
Should I not need two pairs of bracers? $a is a reference to the anonymous
array. The elements of the anonymous arrays are references to anonymous
arrays, correct?
The following seems to achieve this result:
print "${${$a}[ 0 ]}[ 0 ]\n" ;
Well, TIMTOWDI. :) I would have said:
print "$a->[0][0]\n";
Have you studied the applicable Perl docs?
perldoc perllol
perldoc perldsc
perldoc perlref
perldoc perlreftut
They explain it better than I ever would be able to...
If you seek help here to better understand references, you'd better do
so via specific questions on one or more of those documents.
--
Gunnar Hjalmarsson
Email: http://www.gunnar.cc/cgi-bin/contact.pl
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/