Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: length or array in a hash

by SuicideJunkie (Priest)
on Nov 09, 2012 at 19:46 UTC ( #1003202=note: print w/ replies, xml ) Need Help??


in reply to length or array in a hash

You're printing the length of a string that goes something like "ARRAY(0xDEADBEEF)"

You need to dereference the arrayref: my $itemCount = @{ $hash{three} };  my $lastIndex = $#{ $hash{three}  }


Comment on Re: length or array in a hash
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others chanting in the Monastery: (15)
As of 2014-10-21 19:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (106 votes), past polls