in reply to Sorting on Exists

This works, but is maybe not as effective as it could be:
my @sorted = sort { $a->{total_rate} <=> $b->{total_rate} } @array; @sorted = ( (grep { defined $_->{vtype_ug} } @sorted), (grep { not defined $_->{vtype_ug} } @sorted) );
Note that the round brackets here are necessary.

Update:
Another way:
my @sorted = map { $_->{total_rate} *= -1 if $_->{vtype_ug}; $_ } sort { $a->{total_rate} <=> $b->{total_rate} } map { $_->{total_rate} *= -1 if $_->{vtype_ug}; $_ } @array ;


holli, /regexed monk/