warning about pipe-to-self opens

R

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. 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 :).
 
R

Rainer Weikusat

Ben Morrow said:
Quoth Rainer Weikusat said:
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.
 
K

Kaz Kylheku

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.
 
R

Rainer Weikusat

Kaz Kylheku said:
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.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top