m//$_
while(<DATA>) {
if (m/the/) {
print "FOUND> $_";
}
}
__DATA__
This is an example of some data you might find in an
input file. To make things simple, I've put it at the
end of the source file, which you can access with the
filehandle DATA. Our little program will loop through
the input and print out any line that has the word
"the" in it. |
| Forward to 20 Minutes: Regular Expressions I
Back to 20 Minutes: Plural Subroutines Up to PerlInside section index Up to Perl Inside course index |
Perl Inside: PerlInside - 13
Copyright © 1999, Brian Jepson
|