#!/usr/bin/perl -w

#######################################################
# class6_05_pattgrabber
#
# 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: 4-28-03
#######################################################

print "what pattern do you want to filter lines with?\n";
chomp($patt = <STDIN>);

$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 class6_05_pattgrabber
