my @array = qw(apple pear banana orange grape); if ( my @matches = grep /n/, @array ) { print "@matches\n"; } else { print "NOTHING FOUND\n"; }