The code that tests for defined is in the section on CAVEAT/limitations, where presumably all kinds of testing including fork-bombs has led to the code shown and perlipc is a more advanced set of functionality. But in the head documentation of perlfork we see after a brief glimpse under the hood:
"To the Perl program that called fork(), all this is designed to be transparent. The parent returns from the fork() with a pseudo-process ID that can be subsequently used in any process-manipulation functions; the child returns from the fork() with a value of 0 to signify that it is the child pseudo-process".
So my disagreement extends also to your post. The OP wanted a solution to which fork is a possible answer I gave because it is simpler than threads. He did not ask for a history of trying to BREAK the fork function. Frankly these "contributions" are a sign of ego problems 'I know something too -- look at me!' which are apt to inhibit learning as well as disrupting the purpose of SOPW -- to answer the questions of OPs!! I will certainly consider the possibility of undef for more complex multiforking situations, but that hardly justifies raising it for this case, where sorry but it's way off topic!
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: |
| & | | & |
| < | | < |
| > | | > |
| [ | | [ |
| ] | | ] |
Link using PerlMonks shortcuts! What shortcuts can I use for linking?
See Writeup Formatting Tips and other pages linked from there for more info.