Please send questions to
st10@humboldt.edu .
#!/usr/bin/perl -w
#######################################################
# lect04_flaky_tester
#
# ask user for pattern, see if you can use it to
# find all lines from file "looky" with that pattern;
#
# modified by Sharon Tuttle from "Learning Perl",
# by Schartz and Phoenix
#
# last modified: 9-14-04
#######################################################
print "what pattern do you want to filter lines with?\n";
chomp($patt = <STDIN>);
# note the kluge to "force" <> operator to read lines from
# looky file... as if I had typed looky on the command
# line...
# $ARGV[0] = "looky";
# filtering through file looky, note!!!
while (<>)
{
chomp;
# see if $_ contains entered pattern
if (/$patt/)
{
printf "line with \$patt $patt:<%s>\n", $_;
}
}
# end of lect04_flaky_tester