Trap 5 - a solution 

sub logged_on_users {
  my @a = sort
          map { $_->username }
          values %sessions;
}