Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Counting elements in array

by thezip (Vicar)
on Jan 29, 2014 at 19:35 UTC ( #1072569=note: print w/replies, xml ) Need Help??


in reply to Counting elements in array

You have (at least) a couple of options:

print "Array size is ", scalar(@array), "\n";
- or -
printf "Array size is %d\n", scalar @array;

Your pick. You need to force scalar context, which I explicitly did by using the scalar function.


*My* tenacity goes to eleven...

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others scrutinizing the Monastery: (9)
As of 2019-10-23 16:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?