Backslashes are a pain in the back. Slash. The problem is that your regex ends up being /TRicky\(.*?)\endTricky/ because your variables interpolate. When that gets compiled as a regex, it's a problem because the trailing backslash of "TRicky\" has escaped the opening parenthesis. I would suggest using my $StartTag = qr/TRicky\\/; my $EndTag = qr/\\endTricky/; The qr// operator will keep things properly backslashed later, because the content is treated like a regex.
Jeff japhy Pinyan,
P.L., P.M., P.O.D, X.S.:
Perl,
regex,
and perlhacker How can we ever be the sold short or the cheated, we who for every service have long ago been overpaid? ~~ Meister Eckhart