If you're going to use terms in a different way than what they actually
mean, it's going to be difficult to produce something that does what you
believe it should do *and* what it should actually do.

A pipe is for communication with a process. "Piped to a file" means what?
What's the process you're communicating with?

More to the point, "run" is intended to be lower level, specifically so you
can directly control things. Things like redirection and shell pipelines
are higher level.

That said, :out and :err are incompletely documented; the form that tells
it to create pipes so your script can communicate with the process is
there, but you can also specify handles to attach them to. In which case
you would open a file, then say :out($myHandle) to attach the process's
stdout to the handle $myHandle.

On Wed, Jun 20, 2018 at 11:33 AM Theo van den Heuvel <vdheu...@heuvelhlt.nl>
wrote:

> Hi all,
>
> trying to make sense of the documentation on run:
> https://docs.perl6.org/routine/run.
> In particular the last part. I don't  understand the adverbs :out and :
> err there.
> Can I set it up so that the output is piped into a file directly? If so
> how would I write that?
>
> I know I could use shell for that, but I doubt that is necessary.
>
> [On first reading I found the doc confusing because it start with a
> hairy example. WHy would anyone wish to write to a file named
> '>foo.txt'? How can that be the first example?]
>
> Thanks,
>
> --
> Theo van den Heuvel
>


-- 
brandon s allbery kf8nh                               sine nomine associates
allber...@gmail.com                                  ballb...@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Reply via email to