in reply to Re^4: How i can create hash of arrays of hashes from my 3 arrays?
in thread How i can create hash of arrays of hashes from my 3 arrays?
... detirmine the [most] recent dates from users
The date-timestamps are held in the anonymous array references that are the values of the key(s) of $hash{$id}{$net}. As suggested by choroba here, the particular format of these date-timestamps is easily sort-ed to determine temporal order:
Try some other date-timestamps (with the identical format!) and convince yourself this is true.Win8 Strawberry 5.8.9.5 (32) Sun 03/14/2021 21:56:16 C:\@Work\Perl\monks >perl -Mstrict -Mwarnings my %hash; $hash{'ID'}{'NET'} = [ qw( 2019-11-07T20:31:10.000Z 2021-03-10T13:58:50.000Z 2021-02-19T13:47 +:25.000Z ) ]; my $most_recent_date_time = (sort @{ $hash{'ID'}{'NET'} })[-1]; print "'$most_recent_date_time' \n"; ^Z '2021-03-10T13:58:50.000Z'
(And congratulations on having had an almost-complete solution finally delivered into your hands! Please see the Offering Plate. :)
Give a man a fish: <%-{-{-{-<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^6: How i can create hash of arrays of hashes from my 3 arrays?
by chandantul (Scribe) on Mar 15, 2021 at 14:24 UTC |