Subject: | Failure with newlines |
Regex::PreSuf (1.15) fails to produce a proper working regex if one of the words contains a newline. For example:
use Regex::PreSuf;
my $re = presuf("foo\tbar", "foo\nbar");
This patch will fix it:
--- Regex-PreSuf-1.15/PreSuf.pm 2000-05-16 18:05:18.000000000 +0200
+++ Regex-PreSuf-edit/PreSuf.pm 2004-05-12 14:30:22.000000000 +0200
@@ -375,7 +375,7 @@
@args = map { s/\\\././g; $_ } @args if $param->{ anychar };
foreach (@args) {
- $_ = [ /(\\?.)/g ];
+ $_ = [ /(\\?.)/gs ];
}
return _presuf(0, $param, @args);