Try this...

if (/\Q$target\E/) { DoStuff; }

Thanks,
Rick
----------------------------------------------------------------
Richard Grakowsky
Systems Specialist, Monroe Community College
[EMAIL PROTECTED]
Office: 585.292.3236 / Fax: 585.427.2749
"Progress occurs when we are no longer willing
to accept the consequences of inaction."


-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] 
Sent: Monday, August 04, 2003 5:14 PM
To: [EMAIL PROTECTED]
Subject: stupid pattern match question

I'm not quite sure how to code this,  (or search for a solution to....)


I want to search a text file, and replace a text string of the format
$xxxxxxx.  Example: I want to search for $sysname in a file, but I want
to
first
assign that string to a perl variable.  I've tried various combinations
of
escaping the $, but it is not working.


so something like this:

$target = "$sysname";

if (/$target/)
{
     print "found $sysname\n";

}


however, if I do this, it works.

if /\$sysname/
{
     print "found $sysname\n";

}



Thanks.
Chris









_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

_______________________________________________
Perl-Win32-Users mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs

Reply via email to