cpan-authors / IPC-Run

https://metacpan.org/pod/IPC::Run
Other
21 stars 38 forks source link

Bareword "POSIX::EINTR" not allowed while "strict subs" in use [rt.cpan.org #46243] #84

Closed toddr closed 6 years ago

toddr commented 7 years ago

Migrated from rt.cpan.org#46243 (status was 'open')

Requestors:

From jeremiah@cpan.org on 2009-05-20 11:02:56:

This is the entire error message I get;

Bareword "POSIX::EINTR" not allowed while "strict subs" in use at /usr/share/perl5/IPC/Run.pm 
line 1346.
BEGIN not safe after errors--compilation aborted at /usr/share/perl5/IPC/Run.pm line 1430.

From toddr@cpan.org on 2010-03-23 04:18:39:

I cannot re-produce this error. Can you give me a perl -V so I have some 
idea how this is happening please? Please also check version 0.85 which 
will be released soon. thanks

From csjewell@cpan.org on 2010-03-23 05:05:29:

On Tue Mar 23 00:18:39 2010, TODDR wrote:
> I cannot re-produce this error. Can you give me a perl -V so I have some 
> idea how this is happening please? Please also check version 0.85 which 
> will be released soon. thanks

I'm not the initial reporter, but I've had this happen before with
constants, and one fix that works (if it was defined by "use constant")
is to make it a function call (in this case, POSIX::EINTR() )
ikegami commented 7 years ago

Using POSIX::EINTR() just defers the error to runtime, hiding the error rather than fixing it.

Using EINTR from Errno.pm instead of POSIX.pm will likely solve the issue.

Better yet, you can bypass the issue by replacing

$! != POSIX::EINTR

with

!$!{EINTR}
toddr commented 6 years ago

merged.