develooper Front page | perl.perl6.users | Postings from June 2018

Re: using run

Thread Previous | Thread Next
From:
Brandon Allbery
Date:
June 20, 2018 15:58
Subject:
Re: using run
Message ID:
CAKFCL4Vwko+eVZ073RvShH48XhxmmMVLj66-e_0g18wv09cPSw@mail.gmail.com
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 <vdheuvel@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
allbery.b@gmail.com                                  ballbery@sinenomine.net
unix, openafs, kerberos, infrastructure, xmonad        http://sinenomine.net

Thread Previous | Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About