http://www.perlmonks.org?node_id=11105989


in reply to Re: I want to save web pages as text rather than as HTML. -- oneliner
in thread I want to save web pages as text rather than as HTML.

Thanks for all that info. It's a lot to digest.

Despite the elegance of a one-liner, I prefer to take one step at a time.

When I try to run the following code:

use strict; use warnings; use LWP::UserAgent; use LWP::Simple; use HTML::TreeBuilder; print HTML::TreeBuilder->new_from_url('http://perl.org')->as_text;

I get the error message << Can't locate object method "new_from_url" via package "HTML::TreeBuilder" >>

What else do I need to add to the code to make it work?