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" ;

Is the outmost pair of bracers with the appropriate symbol ($, @, %) the
default?  If so, how does perl select the correct symbol?



I realize that it is seemingly moot, but it may help my understanding of
more complex structures, like hash of arrays or hash of hases.




Thanks,

Kevin

Kevin Viel, PhD
Post-doctoral fellow
Department of Genetics
Southwest Foundation for Biomedical Research
San Antonio, TX 78227 


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to