Beefy Boxes and Bandwidth Generously Provided by pair Networks
We don't bite newbies here... much
 
PerlMonks  

Re: Counting elements in array

by Discipulus (Monsignor)
on Jan 30, 2014 at 08:39 UTC ( #1072643=note: print w/replies, xml ) Need Help??


in reply to Counting elements in array

Hello,
you can find interesting the fact that $#array_name contain the index of the last element so that ($#array_name + 1) == scalar @array_name.

As stated wisely by some monk, in Perl context is all, as in human languages, this is powerful but not-so-easy-to-manage feature. Consider a read of context in the Modern Perl book. This book is a gem but i dont suggest as a first Perl read: i prefer Perl Cookbook, albeit a little ancient book but a wonderful introduction by examples to many fields where Perl rocks.

hth
L*

There are no rules, there are no thumbs..
Reinvent the wheel, then learn The Wheel; may be one day you reinvent one of THE WHEELS.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (7)
As of 2018-10-22 19:27 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    When I need money for a bigger acquisition, I usually ...














    Results (122 votes). Check out past polls.

    Notices?