in reply to Re: Using IO::CaptureOutput in a child process to caputre STDOUT and STDERR
in thread Using IO::CaptureOutput in a child process to caputre STDOUT and STDERR

small comment: there is no "&" in front of WNOHANG.
sub reaper { my $kid; while ( ( $kid = waitpid(-1, WNOHANG) >0 ) ){}; }
  • Comment on Re^2: Using IO::CaptureOutput in a child process to caputre STDOUT and STDERR
  • Download Code

Replies are listed 'Best First'.
Re^3: Using IO::CaptureOutput in a child process to caputre STDOUT and STDERR
by Anonymous Monk on Apr 10, 2011 at 22:30 UTC
    small comment: there is no "&" in front of WNOHANG.

    Because you removed it! :)

    $ perl -Mstrict -Mwarnings -e " print WNOHANG " Name "main::WNOHANG" used only once: possible typo at -e line 1. print() on unopened filehandle WNOHANG at -e line 1.
      WNOHNAG is defined in:

      use POSIX qw(:sys_wait_h); WNOHANG is a constant value. There is no "&" address of this constant value defined.

      Perhaps I should have said no & address of (&) operator is needed before a constant. And that it is wrong to do that.

      Updated with strikes.

        There is no "&" address of this constant value defined.

        Um, in perl, & is not the address-of operator

        $ perl -MPOSIX=WNOHANG -e "print WNOHANG, &WNOHANG" 11