in reply to Perl code to format the text file by inserting tag in blank line
You should definitely use an appropriate module for this - see Parsing HTML/XML with Regular Expressions for why. You said here that you have security restrictions, and I fully agree with afoken that not using the appropriate modules and instead reinventing the wheel makes it more likely that your code will be a security risk; you should speak to your managers about that. And you may already have the appropriate libraries installed anyway: XML::LibXML is based on libxml2, and XML::Parser (used in e.g. XML::Twig) is based on libexpat.
|
---|