Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:
Hi,
I am searching presence of $string in $lineThis code is part of a larger script, and, at times, I do not even know what special character is present in $string. Is there a way to ignore special characters in a variable? Some thing like "/g" global option or "/i" ignore case option :-) Thanks in Advancemy $line = "CCCC--CCCC--CCC(--CC(O"; my $string = "CCC("; if ($line =~ m/$string/) {print "match";}
|
|---|