$substr="libstdc++" $string="compat-libstdc++.so.6" print "Found" if ( $string =~ /$substr/ ); #### Nested quantifiers in regex; marked by <-- HERE in m/compat-libstdc++ <-- HERE }/ at