1 ffd9a51f 2023-08-04 jrmu #!/usr/bin/perl
3 ffd9a51f 2023-08-04 jrmu # Make a program that prints each line of its input that contains a period
4 ffd9a51f 2023-08-04 jrmu # (.), ignoring other lines of input. Try it on the small text file from the
5 ffd9a51f 2023-08-04 jrmu # previous exercise: does it notice Mr. Slate?
7 ffd9a51f 2023-08-04 jrmu use warnings;
11 ffd9a51f 2023-08-04 jrmu foreach (grep(/\./, <>)) {
15 ffd9a51f 2023-08-04 jrmu #my @words = <>;
16 ffd9a51f 2023-08-04 jrmu #my @matches = grep(/fred/, @words);
17 ffd9a51f 2023-08-04 jrmu #foreach (@matches) {
18 ffd9a51f 2023-08-04 jrmu # print "$_";