#!/usr/bin/perl use strict; use warnings; my @hosts = ('first.host.com', 'second.host.com', 'third.host.com'); # Get the host we were called with my $host = shift; if (defined $host) { # Get the data from the specified host sshx (gather data); } else { # Called with a blank command line, so fire off a call for each # host in our list for $host (@hosts) { # Fire off the same program, but give it a host and tell it to # run in the background system("data_gather.pl $host &"); } }