$ftp->get("$station_name.TXT", "../area/weather/$station_name.TXT") or die "failed to retrieve file $station_name.TXT - $ftp->message"; #### my $ftp = Net::FTP->new("tgftp.nws.noaa.gov", DEBUG => 1); #### #!/usr/bin/perl use strict; use warnings; use Net::FTP; # Log into the ftp # my $station_name = 'EGLL.TXT'; my $ftp = Net::FTP->new("tgftp.nws.noaa.gov", DEBUG => 1); $ftp->login("anonymous", "anonymous") or die "login error - " , $ftp->message; $ftp->cwd("data/observations/metar/stations") or die "cwd failed - ", $ftp->message; $ftp->ascii; # N.B. I changed the destination path here: $ftp->get("$station_name", "d:\\junk\\$station_name") or die "failed to retrieve file $station_name - ", $ftp->message; $ftp->quit; # End ftp session #