use Net::SFTP::Foreign; my $sftp = Net::SFTP::Foreign->new($host, backend => 'Net_SSH2', username => 'user', password => 'aaa'); $sftp->error and die "Unable to connect: " . $ssh->error; $sftp->put("${datafile}IMSI_SICAP.lst","/timesten/IMSI_SICAP.lst", conversion => 'dos2unix');