sub show_progress { my($sftp, $data, $offset, $size) = @_; print "downloaded $offset of $size bytes\r"; }