Skip Menu |

Preferred bug tracker

Please visit the preferred bug tracker to report your issue.

This queue is for tickets about the Data-Dumper CPAN distribution.

Report information
The Basics
Id: 27661
Status: new
Priority: 0/
Queue: Data-Dumper

People
Owner: Nobody in particular
Requestors: erick.dennis [...] epublica.de
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: (no value)



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"; #}