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.plResults:#!/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]";
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.
In reply to Re^4: Capturing errors from 3-arg pipe open in ActivePerl 5.020
by ateague
in thread [SOLVED] Capturing errors from 3-arg pipe open in ActivePerl 5.020
by ateague
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |