Thanks Monks!

keszler (Deacon) on Oct 24, 2011 at 23:49 UTC, your reply worked perfectly! Thanks a lot - this is exactly what I wanted! PS. there's a little typo in the line print "I am child $$. \@kids count = $#kids. my dir is $dirs[$#kid+s+1]\n"; where the last bit should read [$#kids+1] (sorry I am not being anal here, but just for people who might just copy paste this code, which I sometimes do when I search forums).

ikegami (Pope) on Oct 24, 2011 at 23:56 UTC, thanks for the 'use' tips; I am new to perl so this helps. But, Deacon's method is not in series, it is in fact in parallel - I just checked by putting a sleep inside childs and also printing the localtime(time) out to the second. So in fact it is launching all childs at the same time.

JavaFan (Abbot) on Oct 25, 2011 at 00:43 UTC, no I didn't know this, but Deacon's code enlightened me on this.

ikegami (Pope) on Oct 25, 2011 at 04:45 UTC, the array element is given by [$#childs+1] as Deacon showed.

Thanks again Monks! (again I didn't mean to unnecessarily lengthen this comment thread by addressing every point, I just thought it would be helpful for people searching the forum)


In reply to Re: fork : distinguish between different child? by cartmanofvan
in thread fork : distinguish between different child? by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.