I used the m{} syntax and fixed the regexp issues. I'm actually posting on a different computer from the code so the regexp issues were mistyping it.
I'll study the different not equals soon. I didn't realize the the ne was the wrong syntax. I actually had (!~) initially but I read on a webpage that it's better to use "ne".
At first I wasn't sure why I would need flag to determine if I'm in a multi-line /*...*/ comment. The syntax used in the files, always has a * as the first visible character in multi-line comments. Although you're right that it's not required. That's a nice catch. I haven't programmed in C in years.
The only reason for accumulating the text is that the write commands are all together instead of spread out. The actual logic of the write operations take up a page of text and it's nice to treat the write operation as a single block. Since the files are small, avg. is 7k, and the largest are no more than 100k, memory is not a problem. Is this considered bad form in perl?
In reply to Re^2: inserting string only once after matching a pattern
by Anonymous Monk
in thread inserting string only once after matching a pattern
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |