Hi,
I have a bunch of text (multiple paragraphs). I want to find a sentence
like 'Susan * the water' (No its not a HW problem). Here's what I am
doing:
#! /usr/bin/perl
use warnings;
$file="temp.txt";
open(fp,$file) or die "Cant open $file :$!\n";
local $/="";
while (<fp>) {
while( /(susan)(\D+)[the|water]\b/xig )
{
print "$1 $2\n"
}
}
this catches sentences like:
susan swam in the water for long time whereas i wud like
susan swam in the water
What am i doing wrong ?
Mandar
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>