Jul 15, 2009, 6:46 AM
Post #1 of 3
Trying to find lines like this in an input file to be processed:
Problem matching to pattern with variable
(so I can create a new output file with modified path info).
Here is my test:
where $dxlSourcePath is set to:
if ($line =~ m/^(#include[ \t]+<)$dxlSourcePath(.*)/i)
It is not working.
What is confusing is the output from the following debug printout:
The output from above is:
printf("NO MATCH to pattern /^(#include[ \\t]+<)$dxlSourcePath(.*)/i for line='$line'\n");
NO MATCH to pattern /^(#include[ \t]+<)//Server//path//VYE//users.SYS///(.*)/i for line='#include <//Server//path//VYE//users.SYS//utils.inc>^M'
Notice the three trailing slashes at the end of the printed $dxlSourcePath value, before the string '(.*)':
where the heck did they come from??
Any help appreciated.