I need to read a large text file line by line until a certain tag is
found, say <TAG>. This tag will exist on a line by itself. Then I need
read in all subsequent lines, appending them to each other, until the ending tag </TAG> is found, again on a line by itself.

My logic, if you can call it that, looks like this:

TAGAREA: while(<IN>)
{

        if(m/<TAG>/i .. m/<\/TAG>/i)
        {
                $tagarea = $tagarea . $_ ;
        }

        next TAGAREA unless defined $tagarea;
}

I also have a variety of other screen-out tests I perform on $tagarea. If that variable contains any no-no's, I move on to the next TAGAREA.

That's the theory, anyway. The logic isn't functioning. Where am I going wrong?

-- Craig



---
avast! Antivirus: Outbound message clean.
Virus Database (VPS): 0611-1, 03/16/2006
Tested on: 3/16/2006 3:31:00 PM
avast! - copyright (c) 1988-2004 ALWIL Software.
http://www.avast.com




_______________________________________________
ActivePerl mailing list
[email protected]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to