Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re: simple replace question

by poolpi (Hermit)
on Jul 06, 2009 at 19:32 UTC ( #777644=note: print w/ replies, xml ) Need Help??


in reply to simple replace question

If you need to deal with a HTML document:

#!/usr/bin/perl use strict; use warnings; use HTML::TokeParser; # Simple example : my $doc = <<END; <html> <head> </head> <body> <p>FooOooo barbar baz</p> <p>Babar Foofoo zba zba</p> <p>oofOOoof zzbb aarr</p> </body> </html> END my $p = HTML::TokeParser->new( \$doc ); while ( $p->get_tag("p") ) { my $text = $p->get_trimmed_text; print "Text: $text\n"; }


hth,
PooLpi

'Ebry haffa hoe hab im tik a bush'. Jamaican proverb


Comment on Re: simple replace question
Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://777644]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (7)
As of 2015-07-05 05:16 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (60 votes), past polls