my @allFruit = qw/apple apricot banana coconut/; my @someFruit = grep { m/^[ap]/ } @allFruit; print "no. of some fruit: " . scalar(@someFruit) . "\n"; print "some fruit: " . join('*',@someFruit) . "\n"; __OUTPUT__ no. of some fruit: 2 some fruit: apple*apricot
In reply to Re: Extracting subset from list: map unsuitable?
by borisz
in thread Extracting subset from list: map unsuitable?
by loris
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |