From: Larry Wall [mailto:[EMAIL PROTECTED]]
> Richard Proctor writes:
> : In Apocalypse 2, \Q is being used for two things, and I 
> : believe this may be ambiguious.
> : 
> : It has the current \Quote meaning admitibly \Q{oute} it is 
> : also being proposed for a null token disambiguate context.
> : As in $foo\Q[bar].
> 
> Hmm, yes, that's a problem.  I'd forgotten about the quotemeta kludge.
> I'll have to think about it.  Maybe quotemeta becomes \qm{} 
> or some such.

The problem with \Q quotemeta was the biggest thing to jump out at me when
reading A2... That is before my brain turned to mush. Seems like quotemeta
be serving its purpose if you have to consider escaping its contents...
What's the Perl6 equivalent to:

#!perl -w
# script.pl:
my ($match, $filename) = @ARGV;
local $/;
open FH, $filename;
$file = <FH>;
print scalar @{[$file =~ m/(\Q$match\E)/gs]};
1;
__END__

file.txt contents:
{foo}\E{foo}\E{foo}

> script.pl {foo} file.txt
3
>

Reply via email to