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

As you are passing the filehandle into a module, the simplest check would be to call eof on the filehandle before you give it to XML::Twig;

That certainly did the trick, thank you very much!

pipe.pl
#!/usr/bin/perl use 5.020; use strict; use warnings; open (my $ARTICLE, "-|", "caesar"); eof $ARTICLE and die "Can't start caesar:\n$!\n$^E"; my $read = <$ARTICLE>; say "[$read]";
Results:
perl pipe.pl 'caesar' is not recognized as an internal or external command, operable program or batch file. Can't start caesar: Inappropriate I/O control operation The handle is invalid at pipe.pl line 7.