use warnings; use strict; use WWW::Mechanize; my $webcrawler = WWW::Mechanize->new(); my $uri = URI->new('http://perlmonks.org/?node_id=482163'); $webcrawler->get($uri); my @stripped_html; my $x = 0; my $content = $webcrawler->content; my $parser = HTML::TokeParser->new(\$content); while($parser->get_tag) { $stripped_html[0] = $parser->get_trimmed_text()."\n"; print "Inside >${stripped_html[0]}<\n"; } print "Outside >${stripped_html[0]}<\n";