PatrickInDenmar
01-02-2009, 11:49 AM
Hi Iam trying to do a substitution with string variables:
$line =~ s:$source:$target: ;
$source and $target are read from a line in a file. One line I have been using is:
+-MENU ==> %
this line is processed by splitting over ==> and removing white space. This leaves $source to be +-MENU. Howver the + sign is being treated as a metacharacter, not as a string literally.
So how can I further process $source so that the Perl interpreter will treat the string without interpretation ?
$line =~ s:$source:$target: ;
$source and $target are read from a line in a file. One line I have been using is:
+-MENU ==> %
this line is processed by splitting over ==> and removing white space. This leaves $source to be +-MENU. Howver the + sign is being treated as a metacharacter, not as a string literally.
So how can I further process $source so that the Perl interpreter will treat the string without interpretation ?