http://www.perlmonks.org?node_id=1025786


in reply to Re^6: Perl sftp behavior when there are no files in the share
in thread Perl sftp behavior when there are no files in the share

This is untested, because I haven't yet figured out how to use cpan with the perl interpreter on my smartphone :-)

First you need the callback routine, like this:

sub show_progress { my($sftp, $data, $offset, $size) = @_; print "downloaded $offset of $size bytes\r"; }
The \r positions the cursor to the beginning of the line, so that the next print overwrites it.

Then you change

$sftp->get($REM_FILE)
to
$sftp->get($REM_FILE, callback => \&show_progress)
That should do the trick...