$| = 1; $pid = open(first_child, "-|"); if ($pid) { while() { if ($_ =~ m/^Error/) { } #do nothin elsif ($_ =~ m/^Hits/) { push (@hits, $_) ; } else { push (@line, $_); } } } else { my (@child, @cpic); foreach $i(0..@gets) { $e = $gets[$i]; $c = $searches{$e}{handler}; $p = $FORM_DATA{p}; $q = $FORM_DATA{q}; $u = $searches{$e}{url}; $caller = "perl $c $p $q $u"; $cpid[$i] = open($child[$i], "|-"); if ($cpid[$i]) { } # do nothing else { system ($caller); exit; } } foreach (@child) { close($_); } exit; }