Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: Sorting Data::Dumper Output

by shotgunefx (Parson)
on Nov 27, 2001 at 12:53 UTC ( [id://127762]=note: print w/replies, xml ) Need Help??


in reply to Sorting Data::Dumper Output

Wish I could ++ this question twice. I've often found it frustrating. I actually tried looking into actually fixing this yesterday out of frustration via $Data::Dumper::Toaster.
(I'm working on a CGI with a complex data structure that takes four 1024x768 screens to print and has over 30 application screens. Easier to tack it on to the end of the page for Debug purposes.)

Trying to examine the output is tedious to put it mildly.

-Lee

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

Replies are listed 'Best First'.
Re: Re: Sorting Data::Dumper Output
by gwhite (Friar) on Nov 28, 2001 at 22:22 UTC
    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
      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

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://127762]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others sharing their wisdom with the Monastery: (1)
As of 2024-04-25 00:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found