Sorry I forgot to mention in my previous post that inside the parent loop it is processing the output from the child process. But not with the sysread() function. We are doing it like this:
print WRITE $cmd
while (<READ>)
{
if (/blah/)
{
do something
}
else
{
do something else
}
}