On Sun, 03 Jul 2016 07:22:09 -0700, ddgr...@gmail.com wrote: > This works like it should: > > perl6 -e 'my $p; try {$p = Proc::Async.new("asdfcat", </path/to/file that > exists>); CATCH {die "in new"}}; my $pr; try {$pr = $p.start; CATCH {die > "in start"}}; try {await($pr); CATCH {die "in await"}}' > in await > in block at -e line 1 > in block <unit> at -e line 1 > > This doesn't: > > perl6 -e 'my $p; try {$p = Proc::Async.new(:w, "asdfcat"); CATCH {die "in > new"}}; my $pr; try {$pr = $p.start; CATCH {die "in start"}}; try > {await($p.write("hi\n".encode)); CATCH {die "in write"}}; try > {$p.close-stdin; CATCH {die "in close"}}; try {await($pr); CATCH {die "in > await"}}'
Fixed and tested in S17-procasync/nonexistent.t. (The change is to default to ignoring SIGPIPE, since we error-check all operations anyway. Those who do want to exit on SIGPIPE can write `signal(SIGPIPE).tap: { exit 1 }` or so.