in reply to Fork issues

Let me start out by saying that I could not duplicate your exact problem. I think though that your problem lies in over-simple handling of the return values from fork or new and of not calling wait() on the children. At first, I could not get you code to fork at all. Then, after adding proper checks, the code runs fine either in terminal or in background.


s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}

Replies are listed 'Best First'.
Re^2: Fork issues
by starbolin (Hermit) on Feb 13, 2008 at 01:58 UTC

    Ok, my last post was bad advice. Well, maybe good advice but for the wrong reasons. I ran your orignal code with just a minimum of changes and it seems to fork ok. Do you have a sample case that actually does something yet which breaks as you describe?


    s//----->\t/;$~="JAPH";s//\r<$~~/;{s|~$~-|-~$~|||s |-$~~|$~~-|||s,<$~~,<~$~,,s,~$~>,$~~>,, $|=1,select$,,$,,$,,1e-1;print;redo}