Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
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?
[choroba]: Hi Corion! Where have you been?
[Discipulus]: ah! holidays i hope..

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (9)
As of 2017-02-22 08:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Before electricity was invented, what was the Electric Eel called?






    Results (325 votes). Check out past polls.