use strict; use warnings; use Data::Dumper; my @GrepList = ("yesterday", "today", "tomorrow") ; # look for all elements with "to" in the string my @ElementList = grep(/to/i, @GrepList) ; print Dumper(@ElementList); ## In list context, returns the count of number of elements ## that meet the search criteria my $ElementsFound = grep(/to/i, @GrepList) ; print $ElementsFound;