When a Proc::Async object is opened only for reading from the external program (no
:w passed to open), and a write operation such as
say is performed, an exception of type
X::Proc::Async::OpenForWriting is thrown:
my = Proc::Async.new("echo");.start;.say(42);CATCH ;# OUTPUT: «X::Proc::Async::OpenForWriting: Process must be opened for writing with :w to call 'say'␤»
To fix that you can use writable commands with :w flag:
my = Proc::Async.new(:w, 'cat');.stdout.tap( ->);my = .start;await .say('foo');.close-stdin;await ;
Returns the method name that was called and which caused the exception.