in reply to Re^2: 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.

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.
  • Comment on Re^3: Using IO::CaptureOutput in a child process to caputre STDOUT and STDERR
  • Download Code

Replies are listed 'Best First'.
Re^4: Using IO::CaptureOutput in a child process to caputre STDOUT and STDERR
by Marshall (Canon) on Apr 10, 2011 at 23:12 UTC
    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
        My comment was not right.
        See better explanation below.

        &WNOHANG is a deprecated syntax, but still works.

        Yes, & is Perl bitwise operator.
        I consider it bad form to "AND" a constant with itself. Omit the &.

        Update: As a matter of style, I would omit the & in front of WNOHANG. In 'C' that is the way that is is done. I am surprised that you can put & in front of WNOHANG, but ok it is obviously true that in Perl you can. Do as you will, I would not put that & there.