if you spend six months writing code that caters for porting to some non-forkable environment

That's not what we're talking about. It's a single line of code.

And if you were to ask if I would spend the literally 7 seconds it takes to type defined($pid) or die "fork failed: $!"; to save my employer the potential costs of a mysterious failure sometime in the future by replacing it with an error message, even on platforms where fork is supported, then yes, I would! I'm taking your continued disagreement to mean that you wouldn't. Although I disagree with that, I can't stop you from providing your employer with whatever code you like - but that's not what we're talking about either.

We're talking about providing a piece of code to help a stranger, and potentially many other future visitors of this site. In your posts, you showed the usage of fork without a check for an error or a mention that you've omitted the check and why. You can't be certain that on any of the systems where this code might be run in the future, fork will never return undef.


In reply to Re^8: Doing every X seconds by haukex
in thread Doing every X seconds by dideod.yang

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.