sub two_pass { my @sorted = sort { $b->title =~ /Manager/ <=> $a->title =~ /Manager/ } sort { $a->name cmp $b->name } @employees; }