On Thursday, June  6, Marc Chantreux wrote: 
> this isn't obvious to guess that '-' means "you can connect the
> subprocess directly to the perl interpreter". i really think this
> example is worth to be added in the documentation.

Actually -- looks like it is there :-) though on the
Proc page, not the 'run' page --

  https://docs.perl6.org/type/Proc

> +    my $p = run 'cat', '-n', :in, :out;
> +    for <i bet on you raku> {
> +        $p.in.say($_);
> +        say $p.out.lines(1)[0];
> +    }
> +    $p.in.close;

I'm curious about whether you could rely
on a line being emitted right away -- e.g.
if there is some output-buffering of the
command -- this might be better handled by
a react/whenever construct.

Brian

Reply via email to