Re: What is the pipe symbol doing to my array?

[email protected] (ToddAndMargo via perl6-users) Sun, 2 Nov 2025 21:30:51 -0800
Newsgroups perl.perl6.users
Message-ID <[email protected]>
On 11/2/25 8:10 PM, Sean McAfee wrote:
> On Mon, Nov 3, 2025 at 5:25 AM ToddAndMargo via perl6-users <perl6- 
> [email protected] <mailto:[email protected]>> wrote:
> 
>     [0] > my @x="a","b","c","d";
>     [a b c d]
> 
>     [1] > say @x
>     [a b c d]
> 
> 
> Here you're passing a single argument to say, the array @x, which is 
> stringified by calling the gist method on it.  It's the same as if if 
> you had said:
> 
> say @x.gist;
> 
>     [1] > say |@x
>     abcd
> 
> 
> Here you're passing four arguments to say, the elements of @x.  It's the 
> same as if you had said:
> 
> say 'a', 'b', 'c', 'd';
> 
>     I ask because I want to know its effect is on
>           my $proc = run(|@x, :err, :out)
> 
> 
> run takes a slurpy list of arguments, as indicated by the *@args 
> parameter in its documentation <https://docs.raku.org/routine/run>, so 
> it doesn't matter if you explicitly flatten @x with a pipe.  It'll work 
> the same either way.


I guess I am asking what the flattening does.

Why is this proper
     my $proc = run(@x, :err, :out)

and this is not
     my $proc = run(@x, :err, :out)