in reply to Storing regexps in variables

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;