On 5/11/07, Lord Xes <[EMAIL PROTECTED]> wrote:

    if ($line =~ /$string/)

  The problem is that the contents in $string may contain metachars.

Are you looking for quotemeta(), or its cousin \Q?

 if ($line =~ /\Q$string\E/)

Or maybe you really want index, if you're searching for a substring?

  if (-1 != index($line, $string) )

Hope this helps!

--Tom Phoenix
Stonehenge Perl Training

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
http://learn.perl.org/


Reply via email to