
Flomble
New User
Mar 21, 2002, 8:51 AM
Post #1 of 2
(1948 views)
|
|
Periods vanish after s///; command?
|
Can't Post
|
|
I have this script that opens a template, goes through each line, and if the line matches a certain tag, it deletes all the lines after it until another line matches a certain tag. For example: <BEGIN> BLAH BLAH BLAH <END> It would see the begin tag, and delete the lines inbetween until it found the END tag. Here is the code I am using: foreach $Line (@Lines) { chomp($Line); if ($Line =~ m/\<!--BEGINPAGETOP --\>/i) { $DontWrite = "YES"; } if ($Line =~ m/\<!--BEGINPAGEBOTTOM --\>/i) { $DontWrite = "YES"; } if ($Line =~ m/\<!--BEGINTABLEOUTPUT --\>/i) { $DontWrite = "YES"; } if ($Line =~ m/\<!--BEGINMINIOUTPUT --\>/i) { $DontWrite = "YES"; } if (($DontWrite ne "YES") && ($Line ne "")) { $WriteMe .= qq($Line\n); } if ($Line =~ m/\<!--ENDMINIOUTPUT --\>/i) { $DontWrite = "NO"; } if ($Line =~ m/\<!--ENDTABLEOUTPUT --\>/i) { $DontWrite = "NO"; } if ($Line =~ m/\<!--ENDPAGETOP --\>/i) { $DontWrite = "NO"; } if ($Line =~ m/\<!--ENDPAGEBOTTOM --\>/i) { $DontWrite = "NO"; } }
For some damn reason, each time it does this routine, one period (.) in the template is stripped. So if I have: welcome to mysite.org. The first run it becomes: welcome to mysiteorg. When I run again: welcome to mysiteorg I can't figure out why it is doing this. Can someone help me?
|