Help for this page
my @sorted = sort { $a->{total_rate} <=> $b->{total_rate} } @array; ... (grep { defined $_->{vtype_ug} } @sorted), (grep { not defined $_->{vtype_ug} } @sorted) );
my @sorted = map { $_->{total_rate} *= -1 if $_->{vtype_ug}; $_ } ... map { $_->{total_rate} *= -1 if $_->{vtype_ug}; $_ } @array ;