in reply to (tye)Re: sorting an array with an array
in thread sorting an array with an array

Per Abigail-II's trail of thought with context sensitivity added:
sub filter (&@) { (wantarray ? sub { @_ } : sub { join '', @_ } )->( map { local $_ = $_; $_[0]->(); $_ } @_[1 .. $#_] ); }
However, I really find this silly, as you can simply do the following:
sub filter (&@) { my ($func, @out) = @_; $func->() for @out; wantarray ? @out : join '', @out; }

Makeshifts last the longest.