In addition to quotemeta, note also that if you want to match many strings against each line in a file, it's much more efficient to combine all the strings into a single pattern, so something like the following:
my @strings = (
'nnxx.yy2 = 234 abc',
'foo bar = 39 baz *',
....
);
my $pattern = join '|',
map { my $s = quotemeta; $s =~ s/(=\s*)\d+/$1\\d+/g; $s } @strings
+;
my $qr = qr/^($pattern)$/;
while (<>) {
print if /$qr/;
}
In the code above I only convert numbers into \d+ if preceded by '='. I've also added ^ and $ anchors to the pattern, which you may or may not want.
Dave.