Bug#611434: clarify $Data::Dumper::Sortkeys
jidanni at jidanni.org
jidanni at jidanni.org
Sat Jan 29 09:12:17 UTC 2011
Package: perl-doc
Version: 5.10.1-17
Severity: wishlist
File: /usr/share/man/man3/Data::Dumper.3perl.gz
I recommend you add a clarification to
o $Data::Dumper::Sortkeys or $OBJ->Sortkeys([NEWVAL])
Can be set to a boolean value to control whether hash keys
are dumped in sorted order. A true value will cause the keys
of all hashes to be dumped in Perl's default sort order.
ALL hashes?
$ cat r.pl
use Data::Dumper;
my %h=(qw/a 1 b 2 c 3/);
print keys %h;
print sort keys %h;
print Dumper(%h);
$Data::Dumper::Sortkeys = 1;
print Dumper(%h);
$ perl -lw r.pl
cab
abc
$VAR1 = 'c';
$VAR2 = '3';
$VAR3 = 'a';
$VAR4 = '1';
$VAR5 = 'b';
$VAR6 = '2';
$VAR1 = 'c';
$VAR2 = '3';
$VAR3 = 'a';
$VAR4 = '1';
$VAR5 = 'b';
$VAR6 = '2';
More information about the Perl-maintainers
mailing list