in reply to Re^2: Capturing the stdout and exit code from a program piped to perl
in thread Capturing the stdout and exit code from a program piped to perl

Hi, I tried it on Cygwin (linux/bash emulator under Windows) and AIX (IBM's brand of Unix). This is the message under AIX:
ls foobar.* | perl -E ' $return_code = `echo $?`; say scalar $return +_code;' ls: cannot access foobar.*: A file or directory in the path name does +not exist. 0
Well, now that I think about it, I translated into English the original message, to make it clearer to the English-speaking reader.
  • Comment on Re^3: Capturing the stdout and exit code from a program piped to perl
  • Download Code