C
cp
Mitchua said:I have apache running on 2 linux boxes, one running Redhat 7.3 and the other
Mandrake 9.1. I have a simple Perl script that uses "head $url" from
LWP::Simple to access the header of a web page. It runs fine on the
Mandrake machine but returns 'false' on the Redhat machine with no other
errors. They both have the LWP::Simple module installed but are using
different versions of perl (if that matters).
I might. But you haven't provided any code that illustrates the
problem, so it's hard to tell.
If I run another perl script that uses "get $url", they both return the
webpage. So why can't the Mandrake machine access the header information?
Dunno. Show some code?
Thanks for any insight you could give me.
Help us to help you. Please be more specific. Instead of "it runs
fines..." and "it returns false" it is more helpful to provides some
specifics. What did you expect it to return? What did it return
instead? Were there messages in the error log? Can you run it from the
command line? Is the output different when you do?
Shooting in the dark, perhpas this bit from perldoc LWP::Simple
provides insight:
CAVEAT
Note that if you are using both LWP::Simple and the very
popular CGI.pm module, you may be importing a `head' func-
tion from each module, producing a warning like "Prototype
mismatch: sub main::head ($) vs none". Get around this
problem by just not importing LWP::Simple's `head' func-
tion, like so:
use LWP::Simple qw(!head);
use CGI qw
head()
Then if you do need LWP::Simple's `head' function, you can
just call it as `LWP::Simple::head($url)'.
SEE ALSO
the LWP manpage, the lwpcook manpage, the LWP::UserAgent
manpage, the HTTP::Status manpage, the lwp-request man-
page, the lwp-mirror manpage