http://qs1969.pair.com?node_id=1180733

ctilmes has asked for the wisdom of the Perl Monks concerning the following question:

What is the right way to recognize a bad executable when creating a Proc::Async?

And why, when I try to send the bad executable input does my CATCH not seem to catch the error?
try { my $proc = Proc::Async.new('bad-executable', :w); my $done = $proc.start; say "try sending to bad executable"; await $proc.say("hi there"); say "worked"; $proc.close-stdin; await $done; CATCH { default { say "caught"; } } } say "done";
Running:
$ perl6 -v This is Rakudo version 2017.01 built on MoarVM version 2017.01 implementing Perl 6.c. $ perl6 testit.pl try sending to bad executable $