in reply to Howto Access Two Consecutive Hosts with Net::SFTP

if you can use keys for authentication instead of user/password pairs, then try Net::SFTP::Foreign:
use Net::SFTP::Foreign; my $sftp = Net::SFTP::Foreign->new( open2_cmd => ['ssh', '-l', $proxy_user, $proxy_host, 'ssh', '-l', $user, $host, '-s', 'sftp'] ) || die 'cannot login $!\n'; $sftp->put($home,$path1) || die "cannot open: $!";