R
Rodney
In the example below, I'm testing if a string contains either the { or }
braces. The problem is that it is causing me a syntax error. The { on the
end of line #1 is pairing with the } on line #11 that is within the
=~m/\}/ pattern search.
Can anyone explain how to avoid this?
-------------------------------------------------------
#1 if ($bodytest_line =~ m/\{/) {
#2 $StartBraceComment = 1;
#3 $bodyTextLen = length($bodytest_line);
#4 $bodyLineCommentStartPos = index($bodytest_line, "{");
#5 $bodyLineCommentText = substr($bodytest_line,
$bodyLineCommentStartPos, $bodyTextLen);
#6 $bodyLineCommentText = "<I><Font
COLOR=$CommentColor>$bodyLineCommentText";
#7 $bodyLineNotCommentText = substr($bodytest_line, 0,
$bodyLineCommentStartPos);
#8 $bodyLineNotCommentText =
&OpalKeywords($bodyLineNotCommentText);
#9 $bodyLineNotCommentText =
&OpalQuotedText($bodyLineNotCommentText);
#10
#11 if ($bodyLineCommentText =~ m/\}/) {
#12 $bodyLineCommentText2Len = length($bodyLineCommentText);
#13 $bodyLineCommentEndPos2 = index($bodyLineCommentText,
"}");
#14 $bodyLineCommentText2 = substr($bodyLineCommentText,
0, $bodyLineCommentEndPos2);
#15 $bodyLineCommentText2 =
"$bodyLineCommentText</FONT></I>";
#16 $StartBraceComment = 0;
#17 }
#18 }
Thanks,
braces. The problem is that it is causing me a syntax error. The { on the
end of line #1 is pairing with the } on line #11 that is within the
=~m/\}/ pattern search.
Can anyone explain how to avoid this?
-------------------------------------------------------
#1 if ($bodytest_line =~ m/\{/) {
#2 $StartBraceComment = 1;
#3 $bodyTextLen = length($bodytest_line);
#4 $bodyLineCommentStartPos = index($bodytest_line, "{");
#5 $bodyLineCommentText = substr($bodytest_line,
$bodyLineCommentStartPos, $bodyTextLen);
#6 $bodyLineCommentText = "<I><Font
COLOR=$CommentColor>$bodyLineCommentText";
#7 $bodyLineNotCommentText = substr($bodytest_line, 0,
$bodyLineCommentStartPos);
#8 $bodyLineNotCommentText =
&OpalKeywords($bodyLineNotCommentText);
#9 $bodyLineNotCommentText =
&OpalQuotedText($bodyLineNotCommentText);
#10
#11 if ($bodyLineCommentText =~ m/\}/) {
#12 $bodyLineCommentText2Len = length($bodyLineCommentText);
#13 $bodyLineCommentEndPos2 = index($bodyLineCommentText,
"}");
#14 $bodyLineCommentText2 = substr($bodyLineCommentText,
0, $bodyLineCommentEndPos2);
#15 $bodyLineCommentText2 =
"$bodyLineCommentText</FONT></I>";
#16 $StartBraceComment = 0;
#17 }
#18 }
Thanks,