El Nino
07-31-2002, 09:33 PM
I need help writing a perl script that will be run as a cron job. The script needs to connect to a webserver and download a specific page (just the source, no pictures or anything), and then save that to my server. I have tried a script already (attached) but it says unknown error on line 25 when I tried using it (in Windows with ActivePerl). Maybe this isn't the script I need at all. If anyone could help me out, that would be great. Thanks!
ntwaddel
07-31-2002, 09:37 PM
you should just install curl
or use wget :)
El Nino
08-01-2002, 12:36 AM
It's going to be run on a Novell server, so those aren't available. :)
Ahmad
08-01-2002, 07:51 AM
Try this snippet :)
use LWP::Simple;
getstore($url, $file);
http://www.perldoc.com/perl5.6.1/lib/LWP/Simple.html
El Nino
08-01-2002, 01:03 PM
Cool. I checked and that module isn't loaded on our Perl for Netware so hopefully a verson from ActivePerl or one from the Linux version will work.
CyberScript
08-01-2002, 01:55 PM
I wrote an example on how to grab a url via the Socket module, it's nothing fancy but it works for me. I always like to stick with modules that are included with the server so I don't run into as many problems when distributing my code.
Also, I wrote an example on how to send email via Socket too which is included.
Hope this helps..
El Nino
08-01-2002, 05:56 PM
CyberScript, thank you very much! I'll give this script a shot tomorrow at work, I'll have some free time. Thank god for Fridays! :cool:
You know you can download a module to any directory you want and use it there--they almost never *need* to be installed.
Owen
El Nino
08-02-2002, 07:42 AM
Well, I tried running the script and it gave me this error message:
Undefined subroutine &main::error called at socket.pl line 45. Any ideas what went wrong?
CyberScript
08-02-2002, 02:41 PM
Opps! Forgot to change the error subrountines to die. I attached the file again with this change.
Of course if it's trying to call the error subrountine you've got another problem to look forward to aways hehe