in reply to subroutine reference parameters

This doesn't answer your question as to why it is happening...

If you're not too fussy about how the hash's contents are formatted, you could just use the Core Data::Dumper module:

use warnings; use strict; use Data::Dumper; my %hash = (0 => 'a', 1 => 'b', 2 => 'c'); print Dumper(\%hash); __END__ $VAR1 = { '1' => 'b', '0' => 'a', '2' => 'c' };
In addition to arrays and hashes, this can be used for arbitrarily complex Perl data structures.

Replies are listed 'Best First'.
Re^2: subroutine reference parameters
by Marshall (Canon) on Jun 03, 2011 at 18:17 UTC
    As another way of dumping, I've been using pp() in Data::Dump lately. It gives a more compact display but basically same idea as Data::Dumper. example follows...

    use warnings; use strict; use Data::Dump qw(pp); my %hash = (0 => 'a', 1 => 'b', 2 => 'c'); print '%hash=',pp(\%hash),"\n"; __END__ Prints: %hash={ "0" => "a", 1 => "b", 2 => "c" }