First, get in the habit of posting a workable snippet. You'll
get a better response that way.
Second, avoid useless use of interpolation such as
$ftp->put("$file").
Try something like this:
!/usr/bin/perl
use strict;
use warnings;
use Net::FTP;
use constant HOST => 'ftp.cpan.org';
use constant DIR => '/mnt/lib';
use constant FILES => 'libs';
my $ftp = Net::FTP->new(
HOST,
Debug => 1,
Passive => 1,
Timeout => 1
);
$ftp->login('anonymous');
$ftp->cwd(DIR);
$ftp->binary;
foreach my $file(FILES) {
$ftp->put($file) or die "$@\n";
}
$ftp->quit;