samwyse has asked for the wisdom of the Perl Monks concerning the following question:
I have the following code, where "length keys" is returning one when I expect it to return three. Any ideas about what's going on? BTW, this is Strawberry Perl 5, version 12, subversion 1 (v5.12.1) built for MSWin32-x86-multi-thread.
produces the following (note that keys have been changed to protect privacy, they are actually 60-80 characters in length)print length keys %$hashref; print join ',', keys %$hashref; print Dumper $hashref;
1 x,y,z $VAR1 = { 'x' => 0, 'y' => 0, 'z' => 0 };
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Wrong result for "length keys %$hashref"?
by toolic (Bishop) on Mar 14, 2011 at 19:47 UTC | |
Re: Wrong result for "length keys %$hashref"?
by philipbailey (Curate) on Mar 14, 2011 at 19:48 UTC | |
Re: Wrong result for "length keys %$hashref"?
by cdarke (Prior) on Mar 14, 2011 at 23:30 UTC | |
Re: Wrong result for "length keys %$hashref"?
by ikegami (Patriarch) on Mar 14, 2011 at 19:54 UTC | |
by saberworks (Curate) on Mar 14, 2011 at 21:56 UTC | |
by chromatic (Archbishop) on Mar 14, 2011 at 22:02 UTC | |
by ikegami (Patriarch) on Mar 14, 2011 at 22:53 UTC |
Back to
Seekers of Perl Wisdom