I need `dir` help

2018-05-10 Thread ToddAndMargo
Hi All, https://docs.perl6.org/routine/dir perl6 -e 'my $x=dir; say "$x";' Does indeed read the directory, but give me one YUGE string. I need each entry to have some kind of a separator. Many thanks, -T -- ~~ Computers are like air conditioners. They

Re: I need `dir` help

2018-05-10 Thread jerry gay
i'm afraid you didn't read the docs very closely... Returns the contents of a directory as a lazy list of IO::Path objects stringifying an IO::Path object gives you a large string. the examples in the docs take up more room than the description of the routine. here's the first: Examples: > #

Re: I need `dir` help

2018-05-10 Thread Brandon Allbery
On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo wrote: > https://docs.perl6.org/routine/dir > > perl6 -e 'my $x=dir; say "$x";' > > Does indeed read the directory, but give me one YUGE string. > I need each entry to have some kind of a separator. > I'd say you did that to

Re: I need `dir` help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 04:43 PM, Brandon Allbery wrote: On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo > wrote: https://docs.perl6.org/routine/dir perl6 -e 'my $x=dir; say "$x";' Does indeed read the

Re: I need `dir` help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 04:49 PM, ToddAndMargo wrote: On 05/10/2018 04:43 PM, Brandon Allbery wrote: On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo > wrote:     https://docs.perl6.org/routine/dir     perl6 -e

Re: I need `dir` help

2018-05-10 Thread Brandon Allbery
On Thu, May 10, 2018 at 7:49 PM, ToddAndMargo wrote: > On 05/10/2018 04:43 PM, Brandon Allbery wrote: > >> On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo > > wrote: >> It will be easier to track this if you capture into

Re: I need `dir` help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 04:52 PM, ToddAndMargo wrote: On 05/10/2018 04:49 PM, ToddAndMargo wrote: On 05/10/2018 04:43 PM, Brandon Allbery wrote: On Thu, May 10, 2018 at 7:34 PM, ToddAndMargo > wrote:     https://docs.perl6.org/routine/dir

Re: I need `dir` help

2018-05-10 Thread Brandon Allbery
I think you'll need to provide a better explanation of what you're trying to accomplish. I can think of lots of ways to do useful things with the output of dir(), but have no idea which one(s) you need. On Thu, May 10, 2018 at 7:52 PM, ToddAndMargo wrote: > On 05/10/2018

Re: I need `dir` help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 04:52 PM, Brandon Allbery wrote: The last line of my message, quoted above, is there for a reason. An IO::Path is not a Str. I understand now. Thank you!

Re: I need `dir` help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 04:56 PM, Brandon Allbery wrote: I think you'll need to provide a better explanation of what you're trying to accomplish. I can think of lots of ways to do useful things with the output of dir(), but have no idea which one(s) you need. I wanted to loop through entries as an

I need indir help

2018-05-10 Thread ToddAndMargo
Hi All, I am over on https://docs.perl6.org/routine/indir I can make heads of tails out of what is going on. I want to check is a file exists. $ perl6 -e 'say indir("./EchoTest");' ===SORRY!=== Error while compiling -e Calling indir(Str) will never work with any of these multi signatures:

Re: I need indir help

2018-05-10 Thread Brandon Allbery
Testing whether a file exists is smartmatching an IO::Path (or a Str that gets coerced to one) against :e. "indir" is not "is this file in this directory?", it's "run this code in this directory instead of where I am now". So it's complaining that you didn't tell it what code to run there. On

Re: I need indir help

2018-05-10 Thread ToddAndMargo
On Thu, May 10, 2018 at 8:04 PM, ToddAndMargo > wrote: Hi All, I am over on https://docs.perl6.org/routine/indir I can make heads of tails out of what is going on. I want to

I need regex help

2018-05-10 Thread ToddAndMargo
Hi All, I am trying to convert this over from Perl5: P5: $dir_entry =~ /.*?(\d{1,4}\D\d{1,4}\D\d{1,4}).*${Extension}/; P6: $dir_entry ~~ m/.*?(\d{1,4}\D\d{1,4}\D\d{1,4}).*{$Extension}/; $ perl6 -c GetUpdates.pl6 ===SORRY!=== Unsupported use of {N,M} as general quantifier; in Perl 6

Re: I need regex help

2018-05-10 Thread ToddAndMargo
On Thu, May 10, 2018 at 11:56 PM, ToddAndMargo > wrote: Hi All, I am trying to convert this over from Perl5: P5: $dir_entry =~ /.*?(\d{1,4}\D\d{1,4}\D\d{1,4}).*${Extension}/; P6: $dir_entry ~~

Re: I need regex help

2018-05-10 Thread Brandon Allbery
Pretty much what it's telling you. Instead of the numbers in braces, it's the ** operator with a range after it: \d ** 1..4 (Remember that spaces do nothing in a P6 regex, so you can use them for readability or to separate the range from what follows, etc.) On Thu, May 10, 2018 at 11:56 PM,

Re: I need regex help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 09:13 PM, ToddAndMargo wrote: On Thu, May 10, 2018 at 11:56 PM, ToddAndMargo > wrote:     Hi All,     I am trying to convert this over from Perl5:     P5:     $dir_entry  =~ /.*?(\d{1,4}\D\d{1,4}\D\d{1,4}).*${Extension}/;

Re: any better explanation of look ahead assertions

2018-05-10 Thread Brad Gilbert
On Thu, May 10, 2018 at 9:09 PM, ToddAndMargo wrote: > On 05/10/2018 07:06 PM, Brad Gilbert wrote: >> >> You could read how they work in PCRE > > > What is PCRE? Perl Compatible Regular Expressions, Basically someone reimplemented the regular expression engine found in

Re: any better explanation of look ahead assertions

2018-05-10 Thread ToddAndMargo
On 05/10/2018 07:06 PM, Brad Gilbert wrote: You could read how they work in PCRE What is PCRE?

Re: any better explanation of look ahead assertions

2018-05-10 Thread Brad Gilbert
On Thu, May 10, 2018 at 8:13 PM, ToddAndMargo wrote: > Hi All, > > Looking at: > https://docs.perl6.org/language/regexes#Lookahead_Assertions > https://docs.perl6.org/language/regexes#Lookbehind_assertions > > I can't tell heads from tails. Does anyone know of a

need -c help

2018-05-10 Thread ToddAndMargo
Hi All, I am converting a YUGE program over from Perl 5 to Perl 6 (Perl 5's subs drive me INSANE). $ perl6 -c GetUpdates.pl6 ===SORRY!=== Error while compiling /home/linuxutil/CurlUtils.pm6 Variable '$TimeOut' is not declared. Did you mean '$Timeout'? at /home/linuxutil/CurlUtils.pm6:24 -->

Re: any better explanation of look ahead assertions

2018-05-10 Thread ToddAndMargo
On 05/10/2018 07:12 PM, Brad Gilbert wrote: On Thu, May 10, 2018 at 9:09 PM, ToddAndMargo wrote: On 05/10/2018 07:06 PM, Brad Gilbert wrote: You could read how they work in PCRE What is PCRE? Perl Compatible Regular Expressions, Basically someone reimplemented

Re: need -c help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 07:37 PM, ToddAndMargo wrote: Hi All, I am converting a YUGE program over from Perl 5 to Perl 6 (Perl 5's subs drive me INSANE). $ perl6 -c GetUpdates.pl6 ===SORRY!=== Error while compiling /home/linuxutil/CurlUtils.pm6 Variable '$TimeOut' is not declared. Did you mean

Re: I need regex help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 09:26 PM, ToddAndMargo wrote: On 05/10/2018 09:13 PM, ToddAndMargo wrote: On Thu, May 10, 2018 at 11:56 PM, ToddAndMargo > wrote:     Hi All,     I am trying to convert this over from Perl5:     P5:     $dir_entry  =~

Re: I need `dir` help

2018-05-10 Thread Brad Gilbert
On Thu, May 10, 2018 at 7:02 PM, ToddAndMargo wrote: > On 05/10/2018 04:56 PM, Brandon Allbery wrote: >> >> I think you'll need to provide a better explanation of what you're trying >> to accomplish. I can think of lots of ways to do useful things with the >> output of

Re: I need `dir` help

2018-05-10 Thread ToddAndMargo
On 05/10/2018 05:42 PM, Brad Gilbert wrote: On Thu, May 10, 2018 at 7:02 PM, ToddAndMargo wrote: On 05/10/2018 04:56 PM, Brandon Allbery wrote: I think you'll need to provide a better explanation of what you're trying to accomplish. I can think of lots of ways to do

any better explanation of look ahead assertions

2018-05-10 Thread ToddAndMargo
Hi All, Looking at: https://docs.perl6.org/language/regexes#Lookahead_Assertions https://docs.perl6.org/language/regexes#Lookbehind_assertions I can't tell heads from tails. Does anyone know of a better reference/explanation for beginners? Many thanks, -T