That would just be silly. Perl's Net::FTP module lets you
interact with an FTP server directly, without calling the shell to call
curl to open up a new FTP control connection for every command you
decide to issue.
my $conn = Net::FTP->new('
ftp.somewhere.net');
$conn->login;
$conn->cd("/some/remote/directory");
my @lines = $conn->ls; # short listing
my @long = $conn->dir; # long listing
The actual output is still up to the remote server to format, unfortunately.
curl is a great tool for downloading stuff, but if you need to do more
than just fetch a known file (or set of files by following HTML links),
it's probably not the best thing for the job. For full FTP
browsing around, you're better off using something like Net::FTP, or
Fetch (is Fetch AppleScriptable?) , or scripting the regular old ftp
command with something like expect.