CodeQuestor
CodeQuestor

Reputation: 911

Not able to use 'copy_perm' option in Net::SFTP::Foreign module

I want to copy the file from remote host to the local host with the preservation of file permission, hence i tried to use the 'copy_perm' option as per the documentation of Net::SFTP::Foreign as mentioned 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 below error -

Invalid option 'copy_perm' or bad combination of options at test.pl at line 101.

The line 101 is the Net::SFTP::Foreign object creation as mentioned above. Did i miss anything or anyone has faced same issue before?

Upvotes: 3

Views: 596

Answers (1)

Jim Davis
Jim Davis

Reputation: 5290

That's because copy_perm isn't an option for the new method. You use it in get and put.

Upvotes: 2

Related Questions