in reply to Re: Sending & Executing a perl script on remote machine.
in thread Sending & Executing a perl script on remote machine.

The Net::OpenSSH::Parallel module I am able to complete my task. But still I want to have a library of modules that I can share with my remote nodes. So that I needn't to send a script file every time. I found out that IPC::PerlSSH::Library module is what i required But still I am not sure what are the changes library requires, so that they can be load using load_library function.

  • Comment on Re^2: Sending & Executing a perl script on remote machine.

Replies are listed 'Best First'.
Re^3: Sending & Executing a perl script on remote machine.
by salva (Canon) on Oct 26, 2010 at 09:45 UTC
    I have just released a new version of Net::OpenSSH::Parallel supporting the rsync functionality available from Net::OpenSSH.

    That would allow to maintain a library of perl modules and scripts replicated across all your servers, though it needs the rsync binary installed on them!

    use Net::OpenSSH::Parallel; my $p = Net::OpenSSH::Parallel->new; $p->add_host($_) for @hosts; $p->push('*', 'rsync_put', { recurse => 1 }, '/my/local/perl/library', '/tmp/my-perl'); $p->push('*', 'command', { stdout_file => '%HOST.out', stderr_file => '%HOST.err' }, '/usr/bin/perl -I/tmp/my-perl/lib /tmp/my-perl/script.pl +'); $p->run or die "something failed!"