http://www.perlmonks.org?node_id=992510


in reply to perl strange hash value

When you look at a hash in scalar context you get a rather useless fraction that describes how the buckets are allocated and being used. When you look at a hash in list context, you get a raw dump of key, value, key, value, which is usually what you want.

my %hash = qw( a 1 b 2 c 3 d 4 ); print scalar %hash, "\n"; # prints "3/8" print %hash, "\n"; # prints c3a1b2d4 but in # an unpredictable order of key, value, key, value.

Dave