in reply to [SOLVED] Capturing errors from 3-arg pipe open in ActivePerl 5.020

Can't solve your problem, but for what it's worth it does fail properly on my OS X system. Interestingly though, if I call it like you did with an argument to the non-existent program, *that* error is raised first:

[502]&#9658; perl -E' open ( FOO, "-|", "caesar" ) or die $!; ' No such file or directory at -e line 2. [503]&#9658; perl -E' open ( FOO, "-|", "caesar <article" ) or die $!; ' sh: article: No such file or directory

The way forward always starts with a minimal test.

Replies are listed 'Best First'.
Re^2: Capturing errors from 3-arg pipe open in ActivePerl 5.020
by ateague (Monk) on Nov 16, 2015 at 17:38 UTC

    I got similar results: The shell throws an error, but it never makes it to Perl

    Pipe.pl
    #!/usr/bin/perl use 5.018; use strict; use warnings; open (my $ARTICLE, "-|", "caesar") or die "Can't start caesar: $!\n$^E +"; my $read = <$ARTICLE>; say "[$read]";
    Result:
    perl pipe.pl 'caesar' is not recognized as an internal or external command, operable program or batch file. Use of uninitialized value $read in concatenation (.) or string at pip +e.pl line 9. []