App-rcmd

 view release on metacpan or  search on metacpan

bin/rcmd  view on Meta::CPAN

@ARGV == 2 or die $usage;
my ( $hosts, $cmd ) = @ARGV;
my $contents = do { local ( @ARGV, $/ ) = $hosts; <> };
my @hosts = split ' ', $contents;

# username to use for ssh connections
my $user;
if ($u) {
    $user = $u;
} else {
    $user = getlogin || getpwuid($<) || die "Can't get current username";
}

# multiple connections are established (in parallel)
my %ssh;
for my $host (@hosts) {
    $ssh{$host} = Net::OpenSSH->new(
        $host,
        user    => $user,
        key_path => $private_key_path,
        async   => 1,



( run in 0.238 second using v1.01-cache-2.11-cpan-8d75d55dd25 )