tom123
09-17-2007, 12:03 PM
Hi
I have the following structure:
While ($whatever) {
my %entry = ( 'judge_id' => $$judge{'judge_id'},
'judge_name' => $$judge{'name'},
'category' => $$judge{'products'}{$code},
'num_entries' => $count[0],
);
push(@entries,\%entry);
}
I need to sort the structure by hash key "category".
Doing the following dosent work:
my @entries = sort ({ $entries{$a}->{'category'} cmp $entries{$b}->{'category'} } @entries);
Any Ideas?
I have the following structure:
While ($whatever) {
my %entry = ( 'judge_id' => $$judge{'judge_id'},
'judge_name' => $$judge{'name'},
'category' => $$judge{'products'}{$code},
'num_entries' => $count[0],
);
push(@entries,\%entry);
}
I need to sort the structure by hash key "category".
Doing the following dosent work:
my @entries = sort ({ $entries{$a}->{'category'} cmp $entries{$b}->{'category'} } @entries);
Any Ideas?