Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
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 taking refuge in the Monastery: (11)
As of 2014-07-29 11:43 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (216 votes), past polls