Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

what does $#AoA mean

by BlenderHead (Novice)
on Nov 22, 2009 at 03:11 UTC ( [id://808635]=perlquestion: print w/replies, xml ) Need Help??

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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: perlquestion [id://808635]
Approved by GrandFather
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (2)
As of 2025-07-12 01:03 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.