TokeParser and get_trimmed_text question
From: Boris Shor (bshor_at_Princeton.EDU)
Date: 01/30/04
- Next message: R. Joseph Newton: "Re: print outbut being buffered..."
- Previous message: Teamsolco: "Re: logrotate and perl file handles. How do I know when to reopen my log file?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
To: <beginners@perl.org> Date: Thu, 29 Jan 2004 22:04:37 -0500
Hello,
New Perl programmer here. I am using HTML::TokeParser to parse HTML files.
It is really very useful. In particular, I use the get_trimmed_text()
function quite a bit to extract tag-free text from HTML files.
I usually use the function in this fashion:
$x = $p -> get_trimmed_text('/strong');
Which gets text from the current location until the parser finds a </strong>
tag. Which is fine. But sometimes I want to get trimmed text until a certain
TEXT pattern, not until a certain tag. Does something exist like:
$x2 = $p -> get_trimmed_text(/some regular exp/);
Which would give me tag-free text until I get to "some regular expression"?
Thanks!
Boris
- Next message: R. Joseph Newton: "Re: print outbut being buffered..."
- Previous message: Teamsolco: "Re: logrotate and perl file handles. How do I know when to reopen my log file?"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|