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


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

It seems there is a small error in the code by soonix. The Net::SFTP::Foreign documentation says that ->get takes the local name of the file as second parameter and the rest are options. So if you want to display the progress, you'll also have to provide the local name, for example like this:

... use File::Basename; my $local_name= basename( $REM_FILE ); warn "Saving '$REM_FILE' to '$local_name'"; $sftp->get($REM_FILE, $local_name, callback => \&show_progress) ...