How to pipe a string to process' STDIN?
问题 I have a command that expects input from a pipe. For example, consider the famous cat command: $ echo Hello | cat Hello Suppose I have a string in a Perl 6 program that I want to pipe to the command: use v6; my $input = 'Hello'; # This is the string I want to pipe to the command. my $proc = run 'cat', :in($input); This does not work (I get no output). I can work around the problem by invoking bash and echo : my $proc = run 'bash', '-c', "echo $input | cat"; But is there a way I can do this