if ($children >= 20) { wait(); } if ($pid = fork) { $parent = ""; $parent = $$; $time = localtime(); $children = $children + 1; print MSG "$time Send DK Started For $key - Process ID: $parent\n"; } elsif (defined $pid) { $child = ""; $child = $$; send_dk($key, $val, $child); } elsif ($! =~ /No more process/) { print MSG "$time System Reports No More Processes - $key\n"; exit 1; } else { $time = localtime(); die "MSG->$time Can't fork: $!\n"; } ************* sub send_dk () { @dk = (), $state = ""; @dk = split(/\s+/, $val); $state = substr($key, 4, 2); foreach $item (@dk) { eval { alarm(300); }; $SIG{ALRM} = \&timeout_expect; if (($state =~ /AR/) || ($state =~ /KS/) || ($state =~ /MO/) || ($state =~ /OK/) || ($state =~ /TX/)) { `$swbt_dms $item > $log/$key`; <- Here they are ck_results($key, $log, $item);