Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Re: length or array in a hash

by SuicideJunkie (Vicar)
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}  }

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 romping around the Monastery: (4)
As of 2016-09-01 04:51 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found