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