Hi,
Last night i wanted to use the LWP::UserAgent library on my webserver (Linux).
I already had LWP::Simple installed, but when i tried to use UserAgent in my code my error
logs said the library was not found. So i went into CPAN and installed the "LWP"
library with no reported errors ("cpan> install LWP")
LWP::UserAgent now runs in perl but all requests return blank content.
The status message reports "OK 200", but there is no body content. (I tried the same request
script on my home machine and it works fine).
But now a larger problem has developed with LWP::Simple,
if i use LWP::Simple to fetch any local domains (i.e. virtual hosts) they now return as empty content with no errors.
Here's a test script i wrote which illustrates the problem...
#!/usr/bin/perl
use strict;
use LWP::Simple;
print "fetching http://www.jtrue.com\n";
my $jfr = get "http://www.jtrue.com";
print "BEGIN FETCH______________\n";
print $jfr."\n";
print "END FETCH________________\n";
print "\n\n\nAnd now we fetch something not local...\n";
print " fetching http://www.google.com\n";
my $gfr = get "http://www.google.com";
$gfr =~ s/^(.{100}).*/$1\.\.\./s;
print "BEGIN FETCH______________\n";
print $gfr."\n";
print "END FETCH________________\n";
When i run this in a shell google returns fine, but jtrue.com (A domain on my server) returns blank.
If i take this same script and put it on another server, both domain return fine.
Any help would be tremendous!
Thanks!
Just to clarify...
LWP::UserAgent NEVER returns content regardless of url.
LWP::Simple returns content ONLY if the domain is hosted elsewhere (not locally).
P.S. Digs report no DNS errors.
Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
Read Where should I post X? if you're not absolutely sure you're posting in the right place.
Please read these before you post! —
Posts may use any of the Perl Monks Approved HTML tags:
- a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
| |
For: |
|
Use: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.