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 %
---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';
--
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
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
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