Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Get the length of a list.

by farang (Hermit)
on Jul 27, 2013 at 16:35 UTC ( #1046670=note: print w/ replies, xml ) Need Help??


in reply to Get the length of a list.

Another way, though not necessarily better than the original.

print scalar map $_, (1, 2, 3, 4, 3, 2, 1);
But if other processing is going to be done with the list, might as well just make a named array out of it from the start.


Comment on Re: Get the length of a list.
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (6)
As of 2014-07-11 10:23 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    When choosing user names for websites, I prefer to use:








    Results (224 votes), past polls