Beefy Boxes and Bandwidth Generously Provided by pair Networks
Your skill will accomplish
what the force of many cannot
 
PerlMonks  

Re: Re: Re: Printing a hash in a specific order?

by fruiture (Curate)
on Mar 15, 2003 at 16:41 UTC ( #243317=note: print w/replies, xml ) Need Help??


in reply to Re: Re: Printing a hash in a specific order?
in thread Printing a hash in a specific order?

I was looking for a way to have the output automatically sorted [...] into a pre-determined format when it came out un-ordered.

that's sort then. It depends on what your "pre-determined format" means.(?) I was confused by your example because it dictated the keys to be output in some order (just as the example output displayed no generic order but some specific one) and that's of course impossible to be done generically unless you specify this order without enumarating it. So we end up with sort() or some Hash-tying module that actually stores order of insertion (as you've been pointed to).

--
http://fruiture.de
  • Comment on Re: Re: Re: Printing a hash in a specific order?

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://243317]
help
Chatterbox?
and a log crumbles through the grate...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (6)
As of 2018-07-17 06:25 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    It has been suggested to rename Perl 6 in order to boost its marketing potential. Which name would you prefer?















    Results (355 votes). Check out past polls.

    Notices?