BlenderHead has asked for the wisdom of the Perl Monks concerning the following question:

Hello World:

Have been reviewing this page on how to do complex data structures: http://perldoc.perl.org/perldsc.html

Am working on Arrays of Arrays, and in the print loop they ue the following structure in the conditional:

( 0 .. $#AoA )

I'm wondering what $#AoA means? Specifically, I'm wondering why they put a # sign between the $ and the namespace?

Any help much appreciated.

BH

Replies are listed 'Best First'.
Re: what does $#AoA mean
by ikegami (Patriarch) on Nov 22, 2009 at 04:11 UTC
    $#a is the current last index of the array @a. See perldata.
Re: what does $#AoA mean
by Anonymous Monk on Nov 22, 2009 at 03:26 UTC
    It means last index of @test
    my @test = 1 .. 4; warn scalar @test; warn $#test; __END__ 4 at - line 2. 3 at - line 3.