in reply to Unable to do SCP on multiple machines using Perl's Net::SCP::Expect module

Couple of questions:

I would look at the notes section of Net::SCP::Expect and consider what they say.

I admit this was a cursory look, and I can't compile right now because Net::SSH::Perl won't install due to a missing gmp.h... . Hope you find something useful there...

...the majority is always wrong, and always the last to know about it...
Insanity: Doing the same thing over and over again and expecting different results...
  • Comment on Re: Unable to do SCP on multiple machines using Perl's Net::SCP::Expect module

Replies are listed 'Best First'.
Re^2: Unable to do SCP on multiple machines using Perl's Net::SCP::Expect module
by Technext (Acolyte) on May 03, 2014 at 18:12 UTC

    * I don't see where $HOME is ever getting set, so your destination is??

    --> To be honest, I did not really look at it very seriously because the file was getting copied at the desired location i.e., in the home dir of $user. After i changed it to $ENV{'HOME'}, even the first SCP is not working now. Now i get the following:
    Initiating subroutine to copy war on remote machine... Copying war: remote-web.war Target Machine: xx.xxx.xxx.xx User: tom at /home/tom/perl/5.18.2/lib/site_perl/5.18.2/Expect.pm line 760.ar: P +ermission denied

    * Use of uninitialized value $HOME in string at /home/tom/deploy.pl line 59 I take it this is not all your code?

    --> Yes, it indeed isn't all my code. I only pasted the relevant portions just to avoid cluttering.

    * to clarify, both the transfer and the archive verified to work on the remote machine?

    --> Yes, everything is working if i use the command line.