in reply to Re: Finding a variable string within a variable string.
in thread Finding a variable string within a variable string.

You can either use regexps, or index
if ($string1 =~ /\Q$string2\E/){...} if (index($string1, $string2) != -1){...}
The \Q and \E are to quote metacharacters (so if $string2 is "f.o", you don't end up matching on "foo").

Replies are listed 'Best First'.
Re^3: Finding a variable string within a variable string.
by Moriarty (Abbot) on Dec 14, 2004 at 22:00 UTC

    Thank you, I had an idea that it would be that simple but I was being a bit thick due to the lateness in the day. After working on these problems all day, the brain gets a little numb.

    Moriarty