Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
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 all is quiet...

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2018-07-17 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (363 votes). Check out past polls.

    Notices?