PDA

View Full Version : Very Simple Perl Script


weiterer
08-29-03, 01:14 AM
Hi i dont want you to think im stupid or something but i just cant run this simple script

#! /usr/local/bin/perl
use LWP::Simple;
getstore ("http://mikeshea.net/cached_pages/5.html" ,"./public_html/newsfeeds/slashdot.html");

the scritpt is from:
http://www.mikeshea.net/newsfeeds/

Its Suppose to make a copy of the webpage but it just doest not work, the script runs ok when i telnet to my site and run it, trough the browser it doest not run (i think it cant anyway)

I that that maybe the
,"./public_html/newsfeeds/slashdot.html
was wrong but i tried everything
with full path /home/etc/kk

or just ./home/path)

or /home/path
or even jsut demo.htm
to see at least if its write something but nothing

Can SomeONE PLEASE Tell me where does the script suppose to store the file it grabs or WHY it cant see it anywhere

Regards

weiterer
08-29-03, 01:22 AM
Well suppose my path to the script is
/home/httpd/vhosts/site.com/cgi-bin/script.cgi

and my path to the exampl.htm where i want the script to store the content is
/home/httpd/vhosts/site.com/httpdocs/storeexample.htm

HOW DO I CONFIGURE THE SCRIPT???? Supposing i want to grab www.yahoo.com

YUPAPA
09-20-03, 01:35 AM
Well suppose my path to the script is
/home/httpd/vhosts/site.com/cgi-bin/script.cgi

and my path to the exampl.htm where i want the script to store the content is
/home/httpd/vhosts/site.com/httpdocs/storeexample.htm

HOW DO I CONFIGURE THE SCRIPT???? Supposing i want to grab www.yahoo.com

Try my script


#!/usr/bin/perl
use LWP::Simple;
use strict;

my $path_to_save = '/home/user/full/path/to/saving/dir/page.html';
my $url_to_get = 'http://www.perl.com';

mirror($url_to_get,$path_to_save);

__END__

rob2132
09-29-03, 01:19 AM
Well suppose my path to the script is
/home/httpd/vhosts/site.com/cgi-bin/script.cgi

and my path to the exampl.htm where i want the script to store the content is
/home/httpd/vhosts/site.com/httpdocs/storeexample.htm

HOW DO I CONFIGURE THE SCRIPT???? Supposing i want to grab www.yahoo.com


You said your path is:

/home/httpd/vhosts/site.com/httpdocs/storeexample.htm

However, your script example is set to ./public_html/newsfeeds/slashdot.html.

That will look in the current working directory the script is running in for that path and also have write permissions from the owner of the CGI process. Likely, this doesn't exist, it looks like the entirely wrong path given your example. Try a local write with the proper permissions on the file/directory, confirming that the path is also correct.