itpal has asked for the wisdom of the Perl Monks concerning the following question:

I am a Perl script beginner. I am new to NET::Ssh library. I had a issue that the scp_put(localpath, remotepath) would add single quotes around the file name and extra garbage characters at the end of file name. Any idea how to fix this? For example: scp_put("/home/test/test.txt", "test.txt") would send a file with a file name 'test.txt'.........A
  • Comment on Re^2: To use Shell method on Active Perl

Replies are listed 'Best First'.
Re^3: To use Shell method on Active Perl
by Corion (Patriarch) on Sep 12, 2016 at 14:15 UTC

    Can you please show us a small, self-contained program that exhibits the problem so we can reproduce it? It should look something like the following:

    #!perl -w use strict; use Net::SSH2; my $local = '/home/test/test.txt'; my $remote = 'test.txt'; scp_put($local, $remote );

    (but that example doesn't write anything other than to a file named 'test.txt' for me). Did you maybe read the remote name from a file and did not clean up the line properly?

Re^3: To use Shell method on Active Perl
by Laurent_R (Canon) on Sep 12, 2016 at 17:28 UTC
    Please provide an actual example of what you are doing.

    A simple fix would probably be to avoid hard-coded values in your scp-put() arguments, but to store the values in variables prior to the scp-put() call and pass these variables as arguments..

Re^3: To use Shell method on Active Perl
by salva (Canon) on Sep 13, 2016 at 09:57 UTC
    Net::SSH doesn't provide a scp_put method or sub.