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 () { chomp(); $date{$system} = $_; # Or do other stuff } close(READER); close(WRITER); close(ERROR); }