# New Ticket Created by Jules Field # Please include the string: [perl #127064] # in the subject line of all future correspondence about this issue. # <URL: https://rt.perl.org/Ticket/Display.html?id=127064 >
Given my @lines = "some-text.txt".IO.lines; my $s = 'Jules'; (some-text.txt is about 43k lines) Doing my @matching = @lines.grep(/ $s /); is about 50 times slower than my @matching = @lines.grep(/ Jules /); And if $s happened to contain anything other than literals, so I had to us my @matching = @lines.grep(/ <$s> /); then it's nearly 150 times slower. my @matching = @lines.grep($s); doesn't appear to work. It matches 0 lines but doesn't die. The lack of Perl5's straightforward variable interpolation in regexs is crippling the speed. Is there a faster alternative? (other than EVAL to build the regex) -- ju...@jules.uk