in reply to grep2 (like 'grep', but also return non-matches)
Nice one.
The same but little bit more shortly:
sub grep2 (&@) { my $code = shift; my ($true, $false) = ([], []); push @{ &{$code}() ? $true : $false }, $_ for @_; return ($true, $false); }
|
|---|