1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
#!/usr/bin/perl use strict; use warnings; require Data::Dumper; Data::Dumper->import(qw(Dumper)); local $Data::Dumper::Purity = 1; local $Data::Dumper::Useqq = 1; local $Data::Dumper::Sortkeys = sub { my ($hash) = @_; return [(sort {lc $a cmp lc $b} keys %$hash)]; }; my %test = ( harry => 'foo', larry => { foo2 => 'aar', foo => 'bar', }, ); print Dumper(\%test);
local $Data::Dumper::Purity = $Data::Dumper::Purity = 1;
1 2 3 4 5 6 7 8 9 10 11
#!/usr/bin/perl use 5.12.0; use warnings; my $test = "\n"; require Data::Dumper; Data::Dumper->import(qw(Dumper)); { local $Data::Dumper::Useqq = $Data::Dumper::Useqq = 1; } say Dumper(\$test);