CC: | lee.johnson [...] netbanx.com |
pmvers Net::SFTP::Foreign:1.67
perl -V: Summary of my perl5 (revision 5 version 10 subversion 1)
configuration:
Platform: osname=linux, osvers=2.6.18-128.1.14.el5, archname=i686-linux
The third arg to Net::SFTP::put is a callback whereas the third argument
to Net::SFTP::Foreign::put is a hash of options. This means you can't
currently call Net::SFTP::Foreign::put in :compat mode, with options,
without the fatal error "Can't use string ("copy_perms") as a subroutine
ref".
It would be useful to be able to pass these options in :compat mode.
Quick and untested patch for Net::SFTP::Foreign::Compat:
118 sub put {
119 my $sftp = shift;
120 my $local = shift;
121 my $remote = shift;
122
123 if (@_ && defined($_[0]) && ref($_[0]) eq 'CODE') {
124 unshift(@_,'callback');
125 }
126
127 $sftp->SUPER::put($local, $remote, @_);
128 $sftp->_warn_error;
129 !$sftp->SUPER::error;
130 }