in reply to simple iterate and run cmd script
I feel it is easier to deal with the output this way.use Net::SSH qw(sshopen3); use strict; use warnings; # Watch for children and reap them. This is to avoid zombies left by +the ssh. $SIG{CHLD} = 'IGNORE'; my $command = "/usr/bin/date"; foreach $system (@system_list){ sshopen3( $system, *WRITER, *READER, *ERROR, $command ) || die "ssh +: $!"; while (<READER>) { chomp(); $date{$system} = $_; # Or do other stuff } close(READER); close(WRITER); close(ERROR); }
Lots of stuff in Super Search where I learned this. There are other SSH modules, but this is the one I like.
-Kurt
|
---|