Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re^4: Capturing errors from 3-arg pipe open in ActivePerl 5.020

by ateague (Monk)
on Nov 16, 2015 at 21:03 UTC ( [id://1147841]=note: print w/replies, xml ) Need Help??


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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1147841]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others wandering the Monastery: (4)
As of 2024-04-25 18:52 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found