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:
The \r positions the cursor to the beginning of the line, so that the next print overwrites it.sub show_progress { my($sftp, $data, $offset, $size) = @_; print "downloaded $offset of $size bytes\r"; }
Then you change
to$sftp->get($REM_FILE)
That should do the trick...$sftp->get($REM_FILE, callback => \&show_progress)
In Section
Seekers of Perl Wisdom