Prev: FAQ 1.13 Is it a Perl program or a Perl script?
Next: FAQ 4.14 How can I compare two dates and find the difference?
From: E.D.G. on 26 Jun 2010 22:35 "Jens Thoms Toerring" <jt(a)toerring.de> wrote in message news:88mb75Fu53U1(a)mid.uni-berlin.de... >> use LWP::Simple; >> LWP::Simple::getprint("http://www.webhost.com/file.txt"); > > And that should work - it does for me when putting it into a > Perl script or using e.g. > > perl -MLWP::Simple -e 'getprint "http://www.sn.no"' > > from the command line. Getting error messages about not being > able to access the web server could be the result of a mis- > configured system, that you entered an incorrect URL or that My browser will read the http://www.sn.nl Web site. And PPM works. So my system is connecting. But I keep getting a error that says: 500 Can't connect to www.sn.no:80 (Bad hostname 'www.sn.no') (URL:http://www.sn.no) And on occasion some other type of error will appear. As you proposed, perhaps this is some type of an ActiveState - Windows configuration problem.
From: E.D.G. on 26 Jun 2010 22:48 "RedGrittyBrick" <RedGrittyBrick(a)SpamWeary.invalid> wrote in message news:Ta-dnd0wOoCH1bvRnZ2dnUVZ7tednZ2d(a)bt.com... >> perl -MLWP::Simple -e 'getprint "http://www.sn.no"' No variation of that command works in a compiled program or from the command line. The error message is generally: 500 Can't connect to www.sn.no:80 (Bad hostname 'www.sn.no') (URL:http://www.sn.no) However, my browser will read that site. And PPM works. So that system is able to access Web sites.
From: RedGrittyBrick on 27 Jun 2010 05:59 On 27/06/2010 03:25, E.D.G. wrote: > "Tad McClellan" <tadmc(a)seesig.invalid> wrote in message > news:slrni2c1v8.pie.tadmc(a)tadbox.sbcglobal.net... > >> perldoc LWP::Simple >> has this as its first example: >> perl -MLWP::Simple -e 'getprint "http://www.sn.no"' >> That works fine for me. > > > perl -MLWP::Simple -e "getprint 'http://www.sn.no'" > > And the error that I keep getting for that (or any other Web site) is: > > 500 Can't connect to www.sn.no:80 (Bad hostname 'www.sn.no') > (URL:http://www.sn.no) > > It might be an ActiveState + Widows problem. Quite often I have trouble > getting commands to work properly as they appear in the documentation. > It frequently takes a while to get the right format. Then they work fine > from that point on. > > PPM connects properly to the Internet and downloads modules. So some > type of command does work. > 1) Use nslookup to test Windows' resolution of domain names C:\> nslookup www.sn.no Server: xxxxxxxxxxx Address: nnnnnnnnnnnn Non-authoritative answer: Name: sn.no Address: 85.252.127.171 Aliases: www.sn.no 2) Check for any proxy settings that are checked for by LWP::Simple (via LWP::UserAgent) C:\> set http http_proxy=http://1.2.3.4:8080 You can temporarily remove a proxy setting... C:\> set http_proxy= -- RGB
From: E.D.G. on 27 Jun 2010 13:37 "E.D.G." <edgrsprj(a)ix.netcom.com> wrote in message news:OtadnesmsqezEbjRnZ2dnUVZ_u-dnZ2d(a)earthlink.com... > use LWP::Simple; > LWP::Simple::getprint("http://www.webhost.com/file.txt"); > Problem Solved - It was a virus software blocking problem! The notes posted in response to my first enquiry provided enough information to make it possible to use some logic to determine the nature of this problem. Since people responded that they were not having any trouble with the above Web site access command, since my browser could access Web sites, and since the Perl PPM program worked, that suggested that something might be blocking my Perl program's access to the Web site. And that turned out to be the case. My virus software decided to block that specific Perl application without sending me an easily recognizable warning note stating that it was doing that. And after using some logic and determining that that might be the case I tried the command on a different computer with different virus software. That one did the same thing. However, the virus program clearly indicated that it was blocking the application. And I knew how to tell it to let the Perl application run. It worked. So, now all I need to do is get my other virus program to let the application run. That should not be difficult. This particular program application is quite important in my opinion. And the Newsgroups are important because they can provide people with some fresh approaches when they run into a problem like that. As anyone who does much programming knows, there are times when you have a code error that is invisible to you for some reason. An easy solution can be to let someone else look at the code. He or she might spot the error in a few minutes. Thanks to all for the suggestions.
From: E.D.G. on 27 Jun 2010 13:53 "RedGrittyBrick" <RedGrittyBrick(a)SpamWeary.invalid> wrote in message news:LoOdnTcPU5xnvbrRnZ2dnUVZ7o2dnZ2d(a)bt.com... >> perl -MLWP::Simple -e "getprint 'http://www.sn.no'" > 1) Use nslookup to test Windows' resolution of domain names > 2) Check for any proxy settings that are checked for by LWP::Simple (via Thanks for the helpful suggestions. As one of my other notes explained, after hearing from other people that the command worked for them and by applying some logic I was able to determine that the command was being blocked by my virus software. Over the years, each time I have attempted a Perl program application to run that was dramatically different from ones I have used in the past it took a while to get through a new group of bugs. And this is the first time that I tried to have a Perl program go out on the Internet and read data from Web site files. I have a potentially important freeware program that is presently available to government scientists and independent researchers around the world. And I am trying to add a feature to it that will enable it to access data files from one of my Web sites and use them in its calculations. The data change each week. And if people had to keep manually downloading the new data they would get tired of doing that and probably stop using the program regardless of its value. Having run into that blocking problem myself I can now add a note to the ReadMe files warning program users to check their virus software if the program won't download data for them.
First
|
Prev
|
Next
|
Last
Pages: 1 2 3 Prev: FAQ 1.13 Is it a Perl program or a Perl script? Next: FAQ 4.14 How can I compare two dates and find the difference? |