kvwood (3) [Avatar] Offline
#1
Hello all,

I've been working through Minimal Perl, and it has been a very good learning resource. However, I've been having problems with the lwp-request scripts in section 3.13.4.

I've tried running the scripts on 3 different OSes - Windows 2000, Kubuntu 7.04, and Fedora 7 - and each gives the same error:

Can't locate HTML/FormatText.pm in @INC (@INC contains:
# @INC path text located here, but omitted for post...
.) at /usr/bin/lwp-request line 468.

Running this script (on Linux) to see the line in context:
$ perl -wnl -e '$. >= 458 and $. <= 478 and print "$.: $_";' /usr/bin/lwp-request

gives me this:
458: }
459: my $html = HTML:smiliearse::parse_html($response->content);
460: {
461: $options{'o'} eq 'ps' && do {
462: require HTML::FormatPS;
463: my $f = HTML::FormatPS->new;
464: print $f->format($html);
465: last;
466: };
467: $options{'o'} eq 'text' && do {
468: require HTML::FormatText;
469: my $f = HTML::FormatText->new;
470: print $f->format($html);
471: last;
472: };
473: $options{'o'} eq 'html' && do {
474: print $html->as_HTML;
475: last;
476: };
477: $options{'o'} eq 'links' && do {
478: my $base = $response->base;

I've tried all that I can think of to figure this out, to no avail. I initially ran into the problem on Windows, and submitted a bug report to ActiveState, thinking there was a problem with their packages. However, the same error has appeared on Linux. AFAIK, all have been Perl 5.8.8.xxx.

Has anybody elese had this problem, or know who I can contact for more info?

Thanks,
Kevin Wood
tmaher (37) [Avatar] Offline
#2
Re: lwp-request scripts return an error
> Hello all,
>
> I've been working through Minimal Perl, and it has
> been a very good learning resource. However, I've
> been having problems with the lwp-request scripts in
> section 3.13.4.
>
> I've tried running the scripts on 3 different OSes -
> Windows 2000, Kubuntu 7.04, and Fedora 7 - and each
> gives the same error:
>
> Can't locate HTML/FormatText.pm in @INC
> Thanks,
> Kevin Wood

As indicated in footnote #21 on page 80, the successful use of the -o text option
of lwp-request requires the installation of some additional modules,like so:

perl -M'CPAN' -e 'shell'
cpan> install HTML:smiliearse
cpan> install HTML::FormatText

See chapter 12 for additional info on the use of CPAN.

-Tim
kvwood (3) [Avatar] Offline
#3
Re: lwp-request scripts return an error
Thanks Tim.

I know I read that footnote, but I read it a few days before trying the code, so must have forgotten it!

Kevin Wood