@users = sort { $::a->{count} <=> $::b->{count} } @users; #### my $a = 'john'; @users = sort { $a->{count} > $b->{count} } @users;