Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^2: Get the length of a list.

by LanX (Canon)
on Jul 27, 2013 at 16:41 UTC ( #1046671=note: print w/ replies, xml ) Need Help??


in reply to Re: Get the length of a list.
in thread Get the length of a list.

Lists are not arrays!

see FAQ#What is the difference between a list and an array?

for instance the easiest way to know how many values a function or a grep returned is using a goatse:

DB<101> sub tst {a..z} DB<102> $length =()= tst() => 26 DB<107> grep { $_ % 2 } 1..10 => (1, 3, 5, 7, 9) DB<108> $n =()= grep { $_ % 2 } 1..10 => 5

Cheers Rolf

( addicted to the Perl Programming Language)


Comment on Re^2: Get the length of a list.
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others surveying the Monastery: (8)
As of 2015-07-07 10:12 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (88 votes), past polls