Note that the round brackets here are necessary.my @sorted = sort { $a->{total_rate} <=> $b->{total_rate} } @array; @sorted = ( (grep { defined $_->{vtype_ug} } @sorted), (grep { not defined $_->{vtype_ug} } @sorted) );
my @sorted = map { $_->{total_rate} *= -1 if $_->{vtype_ug}; $_ } sort { $a->{total_rate} <=> $b->{total_rate} } map { $_->{total_rate} *= -1 if $_->{vtype_ug}; $_ } @array ;
In reply to Re: Sorting on Exists
by holli
in thread Sorting on Exists
by ropey
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |