Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
For example, the following simple perl script:
Returns the source of the www.google.com page but fails to return the obvious embedded form.#! /usr/bin/perl use HTML::Form; use HTTP::Request; use LWP; my $ua = new LWP::UserAgent; my $uri="http://www.google.com"; my $req = HTTP::Request->new(GET => $uri); my $res = $ua->request($req); print $res->content; my $form = HTML::Form->parse($res->content, $res->base()); print "Form: ${form}\n";
If instead, I make the last line:
I get the corresponding error message:join(" ", $form->form);
"Can't call method "form" on an undefined value at ./myscript.pl line 14"
which occurs presumably because no form is returned!
I did not have any problems with this previously under RH8.0 with perl 5.8.0-88 and perl-libwww-perl-5.65-2.noarch.rpm
In fact, the above perl scripts still work when under Fedora Core 1 I 'chroot' to my old RH8.0 installation. It thus seems to be that something is wrong with the Fedora Core 1 perl environment.
Any suggestions on what might be going on and how I might troubleshoot it further?
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: HTML::Form->Parse (Perl) not working under Fedora Core 1
by Roger (Parson) on Dec 23, 2003 at 05:31 UTC | |
by Anonymous Monk on Dec 23, 2003 at 14:01 UTC | |
by Anonymous Monk on Dec 23, 2003 at 23:06 UTC | |
by Anonymous Monk on Dec 23, 2003 at 23:50 UTC | |
by Anonymous Monk on Dec 24, 2003 at 00:05 UTC | |
| |
by Anonymous Monk on Dec 23, 2003 at 23:40 UTC |