Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re^4: Help with arrays

by smeezekitty (Novice)
on Sep 22, 2012 at 05:29 UTC ( [id://995044]=note: print w/replies, xml ) Need Help??


in reply to Re^3: Help with arrays
in thread Help with arrays

I think what you want is  $size = $#nums;

Replies are listed 'Best First'.
Re^5: Help with arrays
by MidLifeXis (Monsignor) on Sep 24, 2012 at 13:05 UTC

    I think what you want is $size = $#nums;
    Probably not. $#nums is the index of the last item in the array @nums. In the usual case, that is one less than scalar(@nums), which gives you the size of the @nums array, not the index of the last element.

    --MidLifeXis

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chanting in the Monastery: (7)
As of 2024-04-19 10:21 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found