#!/usr/bin/perl $loops = shift || 200; use LWP::Simple qw(get); print "Testing with $loops children...\n"; for ($i=0;$i<$loops;$i++) { if ($pid = fork) { next; } ## Parent gets the credit... if (defined $pid) { ## ...children do the work get("http://www.blahblah.com/blah.php3?xxx"); exit; } else { ## Uh-oh something is really wrong ## The parent is saying this... die "Fork failed at number $i: $!\n"; } }