if not $tmpl ~~ m/\.txt$/ { ... }
fails the same way.
if not $tmpl ~~ /\.txt$/ { ... }
works like a charm.
Gabor
On Tue, Dec 30, 2014 at 9:48 AM, Patrick R. Michaud
wrote:
> I suspect it may be some weirdness with the way that $_ is being handled
> in smartmatching, then.
>
> I think
I suspect it may be some weirdness with the way that $_ is being handled in
smartmatching, then.
I think there's a slight difference between
$tmpl ~~ /regex/
and
$tmpl ~~ m/regex/
The first one does the equivalent of /regex/.ACCEPTS($tmpl), which ends up
matching $tmpl directly again
No. If I remove the leading m from the regex, then the bug is gone.
Gabor
On Tue, Dec 30, 2014 at 9:19 AM, Patrick R. Michaud
wrote:
> Out of curiosity, is the bug still present if you use /\.txt$/ instead of
> m/\.txt$/ ?
>
> At the moment it looks like a Rakudo bug to me, but I haven't been ab
Out of curiosity, is the bug still present if you use /\.txt$/ instead of
m/\.txt$/ ?
At the moment it looks like a Rakudo bug to me, but I haven't been able to golf
it further to be certain.
Pm
On Tue, Dec 30, 2014 at 09:11:52AM +0200, Gabor Szabo wrote:
> Just to follow-up:
> The problem a
Just to follow-up:
The problem appears in
https://github.com/szabgab/Perl6-Maven/commit/4346c96d63e97def55e789bbeebdbdaebe8b0b33
After that I have replaced the regex match with
if substr($tmpl, *-4) ne '.txt' {
that works correctly, but I'd still like to understand if the bug was in my
code, or
I am puzzled by this.
I have code like this:
my @files = dir("$.source_dir").map({ $_.basename });
for @files -> $tmpl {
if $tmpl !~~ m/\.txt$/ {
debug("Skipping '$tmpl' it does not end with .txt");
next;
}
debug("Source file $tmpl");
}
and