foreach $host(@syshosts) { @sysThread = threads->new( \&findHostNodes, $host ); } sub findHostNodes { my $host = @_; #print some stuff about the node #now find the services on the host foreach $service (@r21services) { @serviceThread = threads->new(\@shutdonwServices, $service); } } sub shutdownServices { shut down the windows services we are looking for }