Re: [Perl-unix-users] perl Hash help

2007-01-24 Thread Mehta, Perdeep
m Subject: Re: [Perl-unix-users] perl Hash help ---8< Easiest way would be to just specify the order in $k you want: ---8< Actually the easiest way would be to use Tie::IxHash::Easy; From the docs:- SYNOPSIS use Tie::IxHash::Easy; tie %

Re: [Perl-unix-users] perl Hash help

2007-01-23 Thread Allegakoen, Justin Devanandan
---8< Easiest way would be to just specify the order in $k you want: ---8< Actually the easiest way would be to use Tie::IxHash::Easy; From the docs:- SYNOPSIS use Tie::IxHash::Easy; tie %x, 'Tie::IxHash::Easy'; --

Re: [Perl-unix-users] perl Hash help

2007-01-23 Thread Bill Luebkert
Mehta, Perdeep wrote: > Hi, > > I am looking for help to retrieve from a Hash of Hashes in insertion > order? I am not an expert in multi-dimensional Hashes, how could I use > Tie::IxHash module with a sub-Hash, if I could? > > Here is an example, I want to retrieve from sub-hash > %{$dir_cont

Re: [Perl-unix-users] perl Hash help

2007-01-23 Thread Andy_Bach
If you want order, you need an array - hashes are unordered. As you're using count as keys, you can sort them (make its a numeric sort) but just push your hash on to an array (an "AoH") instead: while( my $f = readdir( DIR )) { next if( $f eq '.' or $f eq '..' ); my($t

[Perl-unix-users] perl Hash help

2007-01-23 Thread Mehta, Perdeep
Hi, I am looking for help to retrieve from a Hash of Hashes in insertion order? I am not an expert in multi-dimensional Hashes, how could I use Tie::IxHash module with a sub-Hash, if I could? Here is an example, I want to retrieve from sub-hash %{$dir_contents->{$item} in the insertion order. I