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

You can try using Net::OpenSSH::Parallel or even GRID::Machine.
  • Comment on Re: Sending & Executing a perl script on remote machine.

Replies are listed 'Best First'.
Re^2: Sending & Executing a perl script on remote machine.
by rohit_ch (Initiate) on Oct 26, 2010 at 08:07 UTC

    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.

      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!"