in reply to Wrong hash output

After you have populated this hash, try displaying its contents via Data::Dumper. Perhaps you are inadvertently creating more hash keys than you intended. That's extremely easy to do.

Replies are listed 'Best First'.
Re^2: Wrong hash output
by tphyahoo (Vicar) on Jul 17, 2005 at 21:19 UTC
    Agree, and just wanted to say, when you're dumping, dump a reference to the hash and your output will be better. (Don't dump the hash itself)
    use strict; use warnings; use Data::Dumper my %hash = (a=>1) print "hash: " . Dumper( {%hash} ); # not Dumper(%hash)
    good luck!