Re: sub default question
[email protected] (ToddAndMargo via perl6-users) Wed, 19 Nov 2025 02:19:43 -0800
| Newsgroups | perl.perl6.users |
|---|---|
| Message-ID | <[email protected]> |
On 11/19/25 1:38 AM, Peter Pentchev wrote: > On Wed, Nov 19, 2025 at 01:13:23AM -0800, ToddAndMargo via perl6-users wrote: >> Hi All, >> >> https://github.com/rakudo/rakudo/blob/main/src/core.c/Proc.rakumod >> 232: multi sub run(*@args where .so, :$in = '-', :$out = '-', :$err = '-', >> >> Here is my confusion. The above sets >> :$in = '-', :$out = '-', :$err = '-', >> to "-" as the default. >> >> But if you leave >> :$out and :$err >> off the run line, STDOUT and STDERR do not >> get captured and are sent to the console. > > ...that's exactly what "-" means. > > G'luck, > Peter > If :out and "err are left off the run line, they are not used and the STDOUT and STDERR go to the console. If :out and :err are included, the STDOUT and STDERR are captured and your Proc variable are populated with their file handles. So why leaving them out, does not the default shown on line 232 apply?