@ARGV = ("info"); my @ren; while (<>) { # for every line in info m/^\s*(\S+)\s+(\S+)\s*$/ or next; # -f $1 or next; # skip if file to rename does not exist -f $2 and next; # skip if file to rename does not exist push @ren, [ $1, $2 ]; $ren[0]->[2] = "/DE/IN"; $ren[1]->[2] = "/DE/OUT"; } .............. .............. # ftp transfer my $ftp = Net::FTP->new ($server, Timeout => 9000, Debug => 3); $ftp or die "$server: cannot connect: $@"; # If you don't use ~/.netrc $ftp->login ($user,$passwd) or die "$_: Could not login: " . $ftp->message; # change remote directory my ($f1, $f2, $ftp_upload_location) = @$f $ftp->cwd ($ftp_upload_location); .............. ..............