@hosts = qw(hosta hostb hostc); foreach $host (@hosts) { $status{$host} = `rsh -l ems $host /path/command`; }