Cannot use "copy_perm" parameter in Net :: SFTP :: Foreign module

I want to copy a file from remote host to local host while preserving file permissions, so I tried to use the 'copy_perm' option according to Net :: SFTP :: Foreign documentation as given below -

my $sftp = Net::SFTP::Foreign->new(
    host      => $host,
    key_path  => $ssh_key_path,
    copy_perm => 1,
    more      => [ -o => 'Compression yes' ]
);

      

But I am getting the following error -

Invalid "copy_perm" option or bad combination of parameters on test.pl on line 101.

Line 101 is the creation of the Net :: SFTP :: Foreign object as above. Am I missing anything, or has someone faced the same problem before?

+3


source to share


1 answer


This is because it is copy_perm

not an option for the method new

. You use it in get

and put

.



+2


source







All Articles