You are accessing this site in a read-only mode. For full access to all member benefits, including message posting, please login or register. Registration is completely free, simple, and takes only a few seconds.
The message you are replying to and its parents are listed in the reverse order with the most recent posts first. This might not be the whole discussion thread. To read all the messages in this thread please click here.
Thank you, I've tried both ways BTW, and it doesn't give me any more helpful messages. I checked DNS on my server. I can ping the address, and it resolves to an IP just fine. I've checked the perl resolver by issuing a special perl command, and it too resolves just fine. I can wget the site without issue, my /etc/hosts file has two measly entries, so I don't think that a corrupt hosts file has anything to do with it. Why would it work command-line, but not when invoked through the browser?
Tad J McClellan
30 Jul 2009 01:48
> #use strict;
You lose all of the benfits of that pragma when you comment it out like that.
Signature
Tad McClellan email: perl -le "print scalar reverse qq/moc.noitatibaher\100cmdat/"
schnibitz
30 Jul 2009 00:23
Hi everyone, the following code works from my linux shell as root or the 'nobody' accounts: -----------------------------
#!/usr/bin/perl #use strict; #use LWP::Simple; use LWP::UserAgent; #use URI::URL;
my $ua = new LWP::UserAgent; $ua->timeout(120); my $request = new HTTP::Request('GET', 'http://www.yahoo.com'); my $response = $ua->request($request); my $content = $response->content(); print "$content"; print <<HTML; </body> </html> </head> HTML ---------------------------------
BUT when I hit that same .pl file with my browser I get the following error:
500 Can't connect to www.yahoo.com:80 (Bad hostname 'www.yahoo.com')
Can someone help me please? I'm doing something idiotic, I know, and anything you could do to help would be appreciated.