Re: $? and $! equivalents

[email protected] (Brad Gilbert) Fri, 14 Sep 2018 19:17:57 -0500
Newsgroups perl.perl6.language
Message-ID <CAD2L-T03AHaRFXa9aM+AK2H7a7WwfdaFZShuDcAm_qPPuHsysw@mail.gmail.com>
On Fri, Sep 14, 2018 at 5:08 PM Parrot Raiser <[email protected]> wrote:
>
> This is probably going to be a forehead-slapper, but I can't find a
> reference in either perlintro.com or http://docs.perl6.org/
> (5to6-perlfunc or top-down)  for the equivalents of $? and $! in
> P6.What are they?
>
> I want to be able to "run" or "shell" programs, then examine return
> codes and errors. (The immediate case is to see if a program name is
> already in use by running  "which $progname". )

   my $proc = run <echo Hello World>, :out, :!in;
   say $proc.out.slurp;
   say $proc.exitcode;