develooper Front page | perl.perl5.porters | Postings from September 2000

Mulriple File Transfers using NET::FTP module...

John Ooko
September 5, 2000 17:19
Mulriple File Transfers using NET::FTP module...
Message ID:

Can someone out there help? I have written a small script below, to dowload
files for an FTP server. I employed the NET::FTP module. Somehow I cannot
find a command on NET::FTP that can allow mulriple file retieval using a
wildcard or other.

@rem = '--*-Perl-*--
@echo off
if "%OS%" == "Windows_NT" goto WinNT
perl -x -S "%0" %1 %2 %3 %4 %5 %6 %7 %8 %9
goto endofperl
perl -x -S "%0" %*
if NOT "%COMSPEC%" == "%SystemRoot%\system32\cmd.exe" goto endofperl
if %errorlevel% == 9009 echo You do not have Perl in your PATH.
goto endofperl
@rem ';
#line 14
use Net::FTP;

$ftp = Net::FTP->new
	"ftp.******** <ftp://ftp.********> ",
	Timeout => 30
) or die "Could not connect.\n";

$username = "*********";
$password = "*********";

$ftp->login($username, $password)
	or die "Could not log in.\n";


$remotefile = "*******";
$localfile = "*******";

$ftp->retr($remotefile, $localfile)
	or die "Can not get file.\n";

Thanks in advance for your input.

John. Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at | Group listing | About