Jeff Self wrote:
>
> I'm trying to automate a process of grabbing a file from a website. I
> could do a system call and use wget but I would like it to be as
> portable as possible. Here's my function I've written so far:
>
> sub get_games_file() {
> ��������use LWP::Simple;
> ��������
> ��������my $URL = 'http://www.mcn.net/~kenpom/cbbgames.txt';
> ��������my $gamefile = get($URL) or die "Failed to get " . $URL .": $!";
> }
>
> This doesn't give me any errors but it doesn't save the file to my
> computer. Am I on the right track or is there another function that
> works better?
sub get_games_file {
use Fatal qw(open close);
use LWP::Simple;
use HTTP::Status;
my $URL = 'http://www.mcn.net/~kenpom/cbbgames.txt';
my $gamefile = '/home/jeff/games/myfile.txt';
my $rc = mirror( $URL, $gamefile );
warn status_message( $rc ) if is_error( $rc );
}
John
--
use Perl;
program
fulfillment
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]