Re: Running external CLI tool and capturing output

2017-08-10 Thread Tom Browder
On Thu, Aug 10, 2017 at 11:28 Gabor Szabo wrote: > Oh right. Thanks. I forgot about them. Maybe > https://docs.perl6.org/routine/run should mention them as well. > > In any case a simpler way to capture everything might be useful. Maybe not simpler but take a look at my published Perl 6 module

Re: Running external CLI tool and capturing output

2017-08-10 Thread Gabor Szabo
Oh right. Thanks. I forgot about them. Maybe https://docs.perl6.org/routine/run should mention them as well. In any case a simpler way to capture everything might be useful. Gabor On Thu, Aug 10, 2017 at 6:09 PM, Brock Wilcox wrote: > How about qx and qxx? I guess those don't separate/capture s

Re: Running external CLI tool and capturing output

2017-08-10 Thread Brock Wilcox
How about qx and qxx? I guess those don't separate/capture stderr, and don't separate out the params. --Brock On Thu, Aug 10, 2017 at 10:57 AM, Gabor Szabo wrote: > The documentation has a nice example showing how to run an external > program and how to get its output or even its standard erro

Re: Running external CLI tool and capturing output

2017-08-10 Thread Brandon Allbery
"ps. security bad, correctness bad, do the simplest thing even when it's wrong." On Thu, Aug 10, 2017 at 10:57 AM, Gabor Szabo wrote: > The documentation has a nice example showing how to run an external > program and how to get its output or even its standard error. > https://docs.perl6.org/typ

Running external CLI tool and capturing output

2017-08-10 Thread Gabor Szabo
The documentation has a nice example showing how to run an external program and how to get its output or even its standard error. https://docs.perl6.org/type/Proc However it looks a lot more complex than the plain backtick Perl 5 has and more complex than the capture function of Capture::Tiny. IMH

Re: User defined infix operators and whitespace

2017-08-10 Thread Brock Wilcox
I think there are a couple answers. The simple one is yes -- embrace the whitespace. Maybe wrap them in ()', like (2 d 6). Another line of ideas is wrapping things with some other operators. Maybe a special quoting operator or a converter. [[2d6]] # double for dice! "2d6":dice # postfix. This

User defined infix operators and whitespace

2017-08-10 Thread Simon Proctor
So I had a crazy little idea. I've played the odd bit of roleplaying in my time and wanted to created a 'd' operator. Quite simple really. sub infix: ( Int $num, Int $size ) { [+] (1..$size).roll($num) }; sub prefix: ( Int $size ) { 1 d $size } Gives us 3 d 6 to roll 3 six sided dice or a prefi