in reply to Re: Sorting Data::Dumper Output
in thread Sorting Data::Dumper Output

Thanks for all the help, this is what turned out to be the easiest fix, Ovid's suggestion
use Data::Dumper; use Tie::SortHash; %hash = ( x=> 'line 1', z=> [ 1, 2, 4], y=> { file=> 'test.txt', length=> 200, type => 'ASCII' }, a=> 'line 2' ); tie %hash, 'Tie::SortHash', \%hash; print Dumper(\%hash);

and all came out as I desired.

g_White

Replies are listed 'Best First'.
Re: Re: Re: Sorting Data::Dumper Output
by shotgunefx (Parson) on Nov 29, 2001 at 12:27 UTC
    It should always be that easy! Didn't think a tie would work. I just "ass"umed that Data::Dumper was walking the structure in a clandestine fashion.

    -Lee

    "To be civilized is to deny one's nature."

    Update Doesn't work for complex stuctures like HoH :(
    I guess I'll try Data::Denter