warning about pipe-to-self opens

Discussion in 'Perl Misc' started by Rainer Weikusat, Sep 14, 2012.

  1. At least on perl 5.10.1, in contradiction to the documentation which
    states

    Use "defined($pid)" to determine whether the open was
    successful.

    when the implicit fork done by open($fh, '|-') or open($fh, '-|')
    fails for another reason than EAGAIN, the Perl interpreter executes
    Perl_croak with "Can't fork" as argument. Because of this, code which
    is supposed to handle 'pipe-to-self' open errors needs to check the
    return value and the invocation has to be wrapped in an eval {} so
    that the process doesn't die because of this uncaught exception
    (problem observed on Linux at a really inconvenient time :).
    Rainer Weikusat, Sep 14, 2012
    #1
    1. Advertising

  2. Ben Morrow <> writes:
    > Quoth Rainer Weikusat <>:
    >> At least on perl 5.10.1, in contradiction to the documentation which
    >> states
    >>
    >> Use "defined($pid)" to determine whether the open was
    >> successful.
    >>
    >> when the implicit fork done by open($fh, '|-') or open($fh, '-|')
    >> fails for another reason than EAGAIN, the Perl interpreter executes
    >> Perl_croak with "Can't fork" as argument.


    [...]

    > Wow, that bit of code's been there a long time: since perl 3, 18 Oct
    > 1989. It would probably be helpful if you sent a doc patch to p5p.


    IMO, this behaviour should rather be changed than documented. Also, I
    have been on USENET and various other places on the internet since
    1998, ageing from 25 to 39 in the process, and it took me until last
    year to grow a sufficiently thick skin and accumulate enough
    self-confidence to participate reguarly in a Perl-related newsgroup
    because (parts of) the 'Perl community' is (are) the most aggressively
    hostile group of individuals I've so far encountered on this planet,
    especially considering that I'm an entirely self-taught university
    dropout and that the last attempt at doing so brought me into a situation
    were I was 'generously' 'allowed to work' but paid so little money
    that I was technically starving (I'm being completely serious),
    because 'some people' pulled some strings in the background. I would
    never consider sending anything to a Perl mailing list.
    Rainer Weikusat, Sep 16, 2012
    #2
    1. Advertising

  3. Rainer Weikusat

    Kaz Kylheku Guest

    On 2012-09-16, Rainer Weikusat <> wrote:
    > IMO, this behaviour should rather be changed than documented. Also, I
    > have been on USENET and various other places on the internet since
    > 1998, ageing from 25 to 39 in the process, and it took me until last
    > year to grow a sufficiently thick skin and accumulate enough
    > self-confidence to participate reguarly in a Perl-related newsgroup
    > because (parts of) the 'Perl community' is (are) the most aggressively
    > hostile group of individuals I've so far encountered on this planet,


    LOL! You're not exactly Dalai Lama yourself.
    Kaz Kylheku, Sep 16, 2012
    #3
  4. Kaz Kylheku <> writes:
    > On 2012-09-16, Rainer Weikusat <> wrote:
    >> IMO, this behaviour should rather be changed than documented. Also, I
    >> have been on USENET and various other places on the internet since
    >> 1998, ageing from 25 to 39 in the process, and it took me until last
    >> year to grow a sufficiently thick skin and accumulate enough
    >> self-confidence to participate reguarly in a Perl-related newsgroup
    >> because (parts of) the 'Perl community' is (are) the most aggressively
    >> hostile group of individuals I've so far encountered on this planet,

    >
    > LOL! You're not exactly Dalai Lama yourself.


    Especially in earlier times, I imitated to much of this style for
    personal reasons which really don't belong here. But generally, I
    criticize opinions and not people, except insofar a general
    mudslinging contest has already been started. I consider his to be a
    defect, however.
    Rainer Weikusat, Sep 16, 2012
    #4
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Ralf W. Grosse-Kunstleve
    Replies:
    16
    Views:
    579
    Lonnie Princehouse
    Jul 11, 2005
  2. Ralf W. Grosse-Kunstleve
    Replies:
    18
    Views:
    594
    Bengt Richter
    Jul 11, 2005
  3. Ralf W. Grosse-Kunstleve
    Replies:
    2
    Views:
    399
    Dan Sommers
    Jul 12, 2005
  4. falcon
    Replies:
    0
    Views:
    374
    falcon
    Jul 31, 2005
  5. Bart Kastermans
    Replies:
    6
    Views:
    402
    Bart Kastermans
    Jul 13, 2008
Loading...

Share This Page