Subject: | BUG - Data::Dumper::Sortkeys |
Date: | Wed, 20 Jun 2007 18:27:50 +0200 |
To: | bug-Data-Dumper [...] rt.cpan.org |
From: | Erick Dennis <erick.dennis [...] epublica.de> |
To whom it may concern,
I've attached some code which can be used to reproduce buggy behavior
using Data::Dumper 2.121_04 with perl, v5.8.7 built for i686-linux.
Something seems to mingle with the iterator on %foo when
$Data::Dumper::Sortkeys = 1, as the while block below does not print
anything. If $Data::Dumper::Sortkeys = 0 everything works as expected.
Also, if the while block is repeated (2nd while block that is
commented out) it will work the second time, but not the first.
Regards,
Erick Dennis
#!/usr/bin/perl
use strict;
use Data::Dumper;
my %foo = (
a => 1,
b => 2,
c => 3,
);
$Data::Dumper::Sortkeys = 1;
print Dumper(\%foo);
while (my ($k, $v) = each %foo) {
print "$k:$v\n";
}
#while (my ($k, $v) = each %foo) {
# print "$k:$v\n";
#}