#!/usr/bin/perl -w
use strict;
use Net::FTP;
#use CGI::Carp qw(fatalsToBrowser warningsToBrowser);
my $ftp = Net::FTP->new("ftp.xxxxx.xxx");
$ftp->pasv;
$ftp->login('xxx','xxx');
my @files = $ftp->ls('/tst') or die "could not do ls";
print "Content-Type: text/html\n\n";
print "$_\n" for @files;
print "done\n";
####
Net::FTP: Net::FTP(2.61)
Net::FTP: Exporter(5.562)
Net::FTP: Net::Cmd(2.20)
Net::FTP: IO::Socket::INET(1.25)
Net::FTP: IO::Socket(1.26)
Net::FTP: IO::Handle(1.21)
Net::FTP=GLOB(0x81177a8)<<< 220 xxxxxxxx.xxx ULTRA FTP SERVER
Net::FTP=GLOB(0x81177a8)>>> PASV
Net::FTP=GLOB(0x81177a8)<<< 530 Please login with USER and PASS.
Net::FTP=GLOB(0x81177a8)>>> user xxx
Net::FTP=GLOB(0x81177a8)<<< 331 Password required for xxx.
Net::FTP=GLOB(0x81177a8)>>> PASS ....
Net::FTP=GLOB(0x81177a8)<<< 230 CyBo welcomes replicant xxx.
Net::FTP=GLOB(0x81177a8)>>> PASV
Net::FTP=GLOB(0x81177a8)<<< 227 Entering Passive Mode (XXX,XX,XXX,XXX,XXX,XXX).
Net::FTP=GLOB(0x81177a8)>>> NLST /tst
Net::FTP=GLOB(0x81177a8)<<< 150 Opening ASCII mode data connection for file list
Net::FTP=GLOB(0x81177a8)<<< 226 Transfer complete.
Content-Type: text/html
/tst/graphics
/tst/style
/tst/images
done
Net::FTP=GLOB(0x81177a8)>>> QUIT
Net::FTP=GLOB(0x81177a8)<<< 221 Goodbye.
##
##
Net::FTP: Net::FTP(2.61)
Net::FTP: Exporter(5.562)
Net::FTP: Net::Cmd(2.20)
Net::FTP: IO::Socket::INET(1.25)
Net::FTP: IO::Socket(1.26)
Net::FTP: IO::Handle(1.21)
Net::FTP=GLOB(0x8286474)<<< 220 xxxxx.xxx ULTRA FTP SERVER
Net::FTP=GLOB(0x8286474)>>> PASV
Net::FTP=GLOB(0x8286474)<<< 530 Please login with USER and PASS.
Net::FTP=GLOB(0x8286474)>>> user xxx
Net::FTP=GLOB(0x8286474)<<< 331 Password required for xxx.
Net::FTP=GLOB(0x8286474)>>> PASS ....
Net::FTP=GLOB(0x8286474)<<< 230 CyBo welcomes replicant xxx.
Net::FTP=GLOB(0x8286474)>>> PORT XXX,XX,XXX,XXX,XXX,XXX
Net::FTP=GLOB(0x8286474)<<< 200 PORT command successful.
Net::FTP=GLOB(0x8286474)>>> NLST /tst
Net::FTP=GLOB(0x8286474)<<< 425 Can't build data connection: Connection refused
could not do ls at ftp.pl line 9.
Net::FTP=GLOB(0x8286474)>>> QUIT
Net::FTP=GLOB(0x8286474)<<< 221 Goodbye.