Hi Gary

This should be easy. Try this (non tested snippet)

my $keep = "";
while (<IN>) {
        # chomp; # if you want to remove newlines
        if (/(.*?)<p>/i) {
                $keep .= $1;
                last;
        }
        $keep .= $_;
}

print "kept: $keep\n";


hth
charles

On Thu, 3 Aug 2000, Gary Nielson wrote:

> I am having trouble figuring out how to grab the contents of a text file up
> until the first "<p>" and then exit the operation and am needing some advice
> on
> how to approach this. I basically want to inhale a file until it hits the
> first
> <p> and then exit.



-- 
To unsubscribe: mail [EMAIL PROTECTED] with "unsubscribe"
as the Subject.

Reply via email to