Have you looked at Net::FTP? It seems to me that it is very easy to implement what you want in a few additional lines. Maybe something like the untested following code:
#!/usr/bin/perl -w
use strict;
use Net::FTP;
$|++;
my ($host,$user,$password) = ('ftp.example.com','willdooUK','supers3kr
+3t');
my $ftp = Net::FTP->new($host, Passive => 1, Debug => 1)
or die "Couldn't connect to '$host': $!";
$ftp->login($user, $password)
or die "Couldn't login to '$host' as '$user'.";
$ftp->binary; # just to be safe
for my $line (<DATA>) {
chomp;
next unless /\S/;
my ($local, $remote) = split /;/, $file;
if (! $remote) {
warn "Invalid remote name for '$local', ignored";
} elsif (! -f $local) {
warn "Invalid local filename '$local', ignored";
} else {
print "Storing '$local' as '$remote'";
$ftp->put($local,$remote);
print ", done.";
};
};
__DATA__
c:/web/my_local_file.txt;some/remote/dir/target.html
d:/another/web/another_file.html;some/remote/dir/target.css
|