- or download this
while (my $row = $sth->fetchrow_hashref) {
$$patients{$row->{'pat_id'}} ||= {
...
}
$x++;
}
- or download this
my %sorted =
sort { $patients->{$a}{old_file} cmp $patients->{$b}{old_file} }
(keys %{$patients});
my $patients = \%sorted;
# or put { } around the sort expression to do it one line.
- or download this
sort { $$patients{$a}->{old_file} cmp $$patients{$b}->{old_file} }