Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: Wrong result for "length keys %$hashref"?

by toolic (Bishop)
on Mar 14, 2011 at 19:47 UTC ( [id://893131]=note: print w/replies, xml ) Need Help??


in reply to Wrong result for "length keys %$hashref"?

I think you want scalar instead of length. This prints 3:
use warnings; use strict; my $hashref = { 'x' => 0, 'y' => 0, 'zzz' => 0 }; print scalar keys %$hashref;

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-24 22:11 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found