Instead you could use a combination of map and grep:my @foo_bar; foreach my $foo (@fooz) { if ($foo > 12) { push(@foo_bar, $foo - 1); } }
my @foo_bar = map { $_ - 1 } grep { $_ > 12 } @fooz;These constructs can be chained together and that is what makes them highly adaptable. Data flows right to left, though, so watch out.
In reply to Re: Grep Function
by tadman
in thread Grep Fuunction
by iceraider
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |