Blob
1 #!/usr/bin/perl3 # Modify the previous program to allow Fred to match as well. Does it match4 # now if your input string is Fred, frederick, or Alfred? (Add lines with5 # these names to the text file.)7 use warnings;8 use strict;9 use utf8;11 foreach (grep(/[Ff]red/, <>)) {12 print "$_";13 }15 #my @words = <>;16 #my @matches = grep(/fred/, @words);17 #foreach (@matches) {18 # print "$_";19 #}