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


in reply to To Log FTP Transfers.

Here is the more verbose version (from the manual of Net::SFTP:

For GET use:

$sftp->get($remote [, $local [, \&callback ] ]) sub callback { my($sftp, $data, $offset, $size) = @_; print "Read $offset / $size bytes\r"; }

For PUT use:

$sftp->put($local, $remote [, \&callback ]) sub callback { my($sftp, $data, $offset, $size) = @_; print "Wrote $offset / $size bytes\r"; }

See also Callback (computer programming)

Regards, Karl

«The Crux of the Biscuit is the Apostrophe»