my $sftp = Net::SFTP::Foreign->new($host, %args); if ($sftp->error) { $sftp->error and die "unable to connect to remote host: " . $sftp->error; } else { print "Successfully connected to $host!\n\n\n"; } $sftp->put("/tmp/scripttest/upfile4","/home/ftptest/inbound/upfile4", callback => sub { my($sftp, $data, $offset, $size) = @_; print "$offset of $size bytes read\r"; }); print "I got past the upload\n"; exit;