Try 

open (FILE, "$file") or die 'Open failed';      # where $file = 'some path
and/or file name'
while (<FILE>) {
        print "$_" if /\.\?$/;  #       the only the last character of the
line is a <.,?> ! 
        }

hope this give you some ideas ...

-----Original Message-----
From: David Draley [mailto:[EMAIL PROTECTED]]
Sent: September 20, 2001 12:35
To: [EMAIL PROTECTED]
Subject: reg exp


hello -

I am trying to search a <file> for any sentence that ends in "." or "?"  I 
want to only print those sentences that end with "." or "?" I am having 
trouble with the reg expression syntax...

------------------

while (<file>)
    {
$file=<file>;
       if(/\.\?$/){
         print "$only_sentences_that_end_with_._or_?";
      }
    }

-----------------

thanks


_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com/intl.asp


-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to