Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: Re: Hash key ordering question

by shemp (Deacon)
on May 07, 2003 at 18:43 UTC ( #256348=note: print w/replies, xml ) Need Help??


in reply to Re: Hash key ordering question
in thread Hash key ordering question

that will actually sort in string comparison order (the default for sort). for numeric order, you want:
... foreach $key1 (sort {$a <=> $b} keys %hshFoo) { ...

Replies are listed 'Best First'.
Re: Re: Re: Hash key ordering question
by P0w3rK!d (Pilgrim) on May 07, 2003 at 19:18 UTC
    This is what I was looking for. I was trying to do something with Tie::IxHash the last 10 minutes.
    my $t = Tie::IxHash->new(%hshFoo); my @keys = $t->Keys; $t->Reorder(@keys); $t->SortByKey; untie %hshFoo; ...or something

    -P0w3rK!d

Re: Re: Re: Hash key ordering question
by jgallagher (Pilgrim) on May 07, 2003 at 21:55 UTC
    Thanks. That completely slipped my mind.

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (8)
As of 2020-01-24 20:28 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?