Are you streaming the file? Are you slurping it into an array? Are you slurping it into a string? The answer for your question depends strongly on how you are dealing with the file. Please read
How do I post a question effectively? and post your code and sample input so we can understand context. For example, if you have slurped it into a string and wish to remove all text between two tags but not the tags themselves, you can use a
regular expression:
$string =~ /\/patt1\/.*?\/patt2\///sg;
If you are streaming, you can use a flag to monitor whether you are inside a comment or not.