Perl: the Markov chain saw | |
PerlMonks |
Re: Searching through a document and reporting results.by GrandFather (Saint) |
on Jan 30, 2011 at 01:22 UTC ( [id://885086]=note: print w/replies, xml ) | Need Help?? |
You should investigate some of the CPAN modules for manipulating HTML such as HTML::TreeBuilder or HTML::Parser to make parsing your file much easier. If you are working with web pages then LWP and WWW::Mechanize are your friends. Note that in scalar context an array returns its number of elements so you can simply write my $count = @sentences;.
True laziness is hard work
In Section
Seekers of Perl Wisdom
|
|