|
Perl variable string search
How do I search for the value in a string scalar in another string?
eg.
$foo = "Long long ago";
$bar = "ago";
How do I search for $bar in $foo? I can't just use a regexp s/ search because $bar might potentially contain regex metacharacters. Is there a any function which can escape the regexp in $bar or an alternate strstr like function which I can use?
|