bkiahg has asked for the wisdom of the Perl Monks concerning the following question:
** Edit ** Found the answer between not accessing the hash ref correctly and not being able to sort hashes without proper modules. The answer lied (layed?) in doing the sort with my print. Code to follow.'88959b2c541a8854042ef52b45af1075' => { 'files' => [ { 'file_type' => +1, 'date_uploaded' + => '2005-10-25', 'file_name' => +'Name of file.tif', 'date_faxed' => + '' }, { 'file_type' => +2, 'date_uploaded' + => '2005-10-25', 'file_name' => +'some file 823144 N.pdf', 'date_faxed' => + '2005-10-25' } ], 'phone' => 'xxx-xxx-xxxx', 'last_name' => 'Doe', 'dme_num' => '123456', 'old_file' => '2005-10-25', 'dme_pid' => '938edfd95dd42a58 +786330bb8c85f479', 'first_name' => 'John' },
Big thank you to all the monks that replied. Never ceases to amaze me the level of help I get here.foreach my $key (sort { $patients->{$a}->{old_file} cmp $patients->{$b +}->{old_file} } (keys %{$patients})) { # print ... }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Sorting a Hash Ref
by metaperl (Curate) on Oct 26, 2005 at 16:44 UTC | |
by friedo (Prior) on Oct 26, 2005 at 20:31 UTC | |
by Juerd (Abbot) on Oct 26, 2005 at 20:34 UTC | |
by bkiahg (Pilgrim) on Oct 26, 2005 at 17:25 UTC | |
by sauoq (Abbot) on Oct 26, 2005 at 18:23 UTC | |
by bkiahg (Pilgrim) on Oct 26, 2005 at 20:28 UTC | |
by kwaping (Priest) on Oct 26, 2005 at 18:21 UTC | |
by bkiahg (Pilgrim) on Oct 26, 2005 at 19:09 UTC | |
|
Re: Sorting a Hash Ref
by Juerd (Abbot) on Oct 26, 2005 at 20:02 UTC | |
by bkiahg (Pilgrim) on Oct 26, 2005 at 20:58 UTC |