<?xml version="1.0" encoding="windows-1252"?>
<node id="369588" title="Re^2: While loop not exiting when expected." created="2004-06-25 06:22:32" updated="2005-06-28 17:58:49">
<type id="11">
note</type>
<author id="127547">
BazB</author>
<data>
<field name="doctext">
&lt;p&gt;
[broquaint], thanks.&lt;br&gt;
I am aware of [CPAN://Parallel::ForkManager], but I figured it wasn't worth the grief of installing an extra module for a relatively small amount of code.
&lt;/p&gt;

&lt;p&gt;
Of course, that was before I realised my code wasn't playing nice...
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update:&lt;/b&gt; I've tried [broquaint]'s suggestion of [CPAN://Parallel::ForkManager], and that suffers from the same problem on Solaris (5.6.1 and 5.8.4), but is fine on Linux.
&lt;/p&gt;

&lt;p&gt;&lt;b&gt;Update 2:&lt;/b&gt; I tried another tactic - don't read the configuration file and fork children in a single loop.&lt;br&gt;
Instead, I open and read the configuration file and store the information in an array, then iterate over the array using &lt;code&gt;foreach&lt;/code&gt;, kicking off children and reaping as before.&lt;br&gt;
This approach does work correctly, but still doesn't reveal why the original code fails.
&lt;/p&gt;

&lt;!-- Node text goes above. Div tags should contain sig only --&gt;
&lt;div class="pmsig"&gt;&lt;div class="pmsig-127547"&gt;
&lt;hr /&gt;
&lt;font size=1&gt;
&lt;p align=right&gt;If the information in this post is inaccurate, or just plain wrong, don't just downvote - please post explaining what's wrong.&lt;br&gt;
That way everyone learns.&lt;/p&gt; 
&lt;/font&gt;
&lt;/div&gt;&lt;/div&gt;</field>
<field name="root_node">
369584</field>
<field name="parent_node">
369587</field>
</data>
</node>
