$substr="libstdc++" $string="compat-libstdc++.so.6" print "Found" if ( $string =~ /$substr/ );