Task
Connect to a server, change directory, list its contents and download a file as binary using the FTP protocol. Use passive mode if available.




use Net::FTP;
 
my $host = 'speedtest.tele2.net';
my $user = 'anonymous';
my $password = '';
 
my $ftp = Net::FTP.new( host => $host, :passive );
 
$ftp.login( user => $user, pass => $password );
 
$ftp.cwd( 'upload' );
 
$ftp.cwd( '/' );
 
say $_<name> for $ftp.ls;
 
$ftp.get( '1KB.zip', :binary );