C:\>type test.pl #!/usr/bin/perl -w use strict; $|=1; my @ip = qw (192.168.0.1 192.168.0.2 192.168.0.3); my $kid; foreach my $host(@ip) { next if $kid = fork; die "fork: $!" unless defined $kid; & doit($host); exit; } 1 while wait != -1; print "Parent exiting...\n"; exit; sub doit { my $server = shift; print "Doin it to $server, stand clear of the doors please!\n"; } C:\>perl test.pl Doin it to 192.168.0.1, stand clear of the doors please! Doin it to 192.168.0.2, stand clear of the doors please! Doin it to 192.168.0.3, stand clear of the doors please! Parent exiting... C:\>