my $sftp = Net::SFTP::Foreign->new(host =>$host, user => $user, key_path => [$privkey, $pubkey] , more => '-v'); [... debug output ...] Transferred: sent 32700048, received 60544 bytes, in 1.6 seconds Bytes per second: sent 20997978.1, received 38877.7 [... more debug output ..] #### my $BYTES = 0; $sftp->put( "testfile", "testfile", cleanup => 1, callback => sub { my ( $sftp, $data, $offset, $size ) = @_; print $offset ." of ". $size ." bytes copied\n"; last_bytes($offset); } ); print "\nTransferred $BYTES bytes\n"; sub last_bytes { my ($bytes) = @_; $BYTES = $bytes; } #### $curl->getinfo( CURLINFO_SIZE_UPLOAD );