in reply to Re: Hashes do preserve insertion order after all
in thread Hashes do preserve insertion order after all
BTW, of course this works...:
#!/usr/bin/perl use strict; use warnings; use feature qw/say/; my $HC = 0; my %hoh = ( foo => { value => 'second', time => $HC++}, bar => { value => 'first', time => $HC++}, baz => { value => 'third', time => $HC++}, ); for my $elem (sort {$a->{time} <=> $b->{time}} values %hoh) { say "value => " . $elem->{value}; }
bw, bliako
|
|---|