On Sun, Jan 17, 2016 at 2:10 PM, Tom Browder <[email protected]> wrote:
> On Sun, Jan 17, 2016 at 1:55 PM, Bruce Gray <[email protected]> wrote:
>> On Jan 17, 2016, at 11:07 AM, Tom Browder <[email protected]> wrote:
>>
>>> I'm trying to write all new Perl code in Perl 6. One thing I need is
>>> the equivalent of the Perl 5 qr// and, following Perl 6 docs, I've
> ...
>
> I'll try all that, Bruce. Thanks!
Hm, I'm not getting good results (> 20 sec vs 10 sec). I realize I
may have oversimplified what I'm trying to do. My incoming data lines
are complete file names. I want to ignore file names whose path meets
certain partial paths. So my working Perl 6 example, fully-escaped,
should be:
my regex dirs_to_ignore {
^ \s* [ # non-capture grouping
\/home\/user\/\.cpan |
\/home\/user\/some\-dir
]
}
And it runs very fast and accurately. When I remove the backslashes
and use single quotes around the partial paths it also DOES work as
shown here!!
my regex dirs_to_ignore {
^ \s* [ # non-capture grouping
'/home/user/.cpan' |
'/home/user/some-dir'
]
}
I probably made some subtle error previously. Sorry for the wasted bandwidth.
I also tried again auto-building the regex but with no final success.
I could get the string exactly as in the second example bout I
couldn't get it to compile or to be used as a regex as far as I could
tell by timing and output comparison.
Best,
-Tom