#!/usr/bin/env perl
use strict;
use warnings;
use File::Fetch;
my $url = 'http://perldoc.perl.org/File/Fetch.html';
my $ff = File::Fetch->new( uri => $url );
my $where = $ff->fetch( to => '/tmp' ) or die $ff->error;
my $file = $ff->output_file(); # name of local file
print "Fetched $url and stored as $file.\n";
####
[mmusgrove@dev2 ~]$ ./ff.pl
Fetched http://perldoc.perl.org/File/Fetch.html and stored as Fetch.html
[mmusgrove@dev2 ~]$ ls -al /tmp/Fetch.html
-rw-rw-r-- 1 mmusgrove users 38348 Jun 23 2013 /tmp/Fetch.html
####
#!/usr/bin/env perl
use strict;
use warnings;
use File::Fetch;
my $url = 'http://perldoc.perl.org/File/Fetch.html';
my $ff = File::Fetch->new( uri => $url );
my $where = $ff->fetch( to => 'C:/TEMP' ) or die $ff->error;
my $file = $ff->output_file(); # name of local file
print "Fetched $url and stored as $file.\n";
####
C:\Users\mmusgrove\Desktop>perl ff.pl
Fetched http://perldoc.perl.org/File/Fetch.html and stored as Fetch.html.
C:\Users\mmusgrove\Desktop>dir C:\TEMP
Volume in drive C has no label.
Volume Serial Number is 48AA-B4E2
Directory of C:\TEMP
01/10/2014 11:32 AM .
01/10/2014 11:32 AM ..
06/23/2013 02:53 PM 38,348 Fetch.html
1 File(s) 38,348 bytes
2 Dir(s) 165,768,085,504 bytes free