I think you left out the 'd' in the second line of your example code;
Did you mean to say $string="compat-libstdc++.so.6"; ?
The other monks are correct about quotemeta and \Q to fix your regex problem. Also, consider using index, which is designed for just finding one string in another.
print "Found" if index( $string, $substr ) != -1;
In reply to Re: Storing regexps in variables
by Util
in thread Storing regexps in variables
by pando
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |