- or download this
my @sorted = sort {
if ($a->title =~ /Manager/ and not $b->title =~ /Manager/) {
...
$a->name cmp $b->name;
}
} @employees;
- or download this
my @sorted = sort {
($a->title !~ /Manager/) - ($b->title !~ /Manager/)
or $a->name cmp $b->name;
} @employees;
- or download this
use List::MoreUtils qw( part );
...
map { sort { $a->name cmp $b->name } @$_ }
part { $_->title !~ /Manager/ }
@employees;
- or download this
use v5.14;
use strict;
...
}
done_testing();
- or download this
use v5.14;
use strict;
...
subtle => \&subtle,
functional => \&functional,
});
- or download this
my @sorted =
map { keysort { $_->name } @$_ }
part { $_->title !~ /Manager/ }
@employees;