in reply to Re: Using Data::Dumpers Sortkeys subroutine
in thread Using Data::Dumpers Sortkeys subroutine

What would be a more robust way of solving this?

I think natural sort - as Corion suggested - would fit the bill quite well:

use Data::Dumper; use Sort::Naturally; $Data::Dumper::Sortkeys = sub { my ($hash) = @_; return [ nsort( keys %$hash ) ]; };

Replies are listed 'Best First'.
Re^3: Using Data::Dumpers Sortkeys subroutine
by nysus (Parson) on Nov 27, 2008 at 17:22 UTC
    Hmm, that results in an error:
    Bizarre copy of ARRAY in return at /usr/lib/perl/5.8/Data/Dumper.pm li +ne 511, <FH> line 130. Segmentation fault

    $PM = "Perl Monk's";
    $MCF = "Most Clueless Friar Abbot Bishop Pontiff Deacon";
    $nysus = $PM . $MCF;
    Click here if you love Perl Monks