I need to add a few lines in an XML file at a particular node, in Perl. So, I need to search for a particular node and then add those lines. Which parser would you recommend for this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I recommend XML::Twig. It can modify all elements of a certain name, or just one element. It has excellent documentation, including a tutorial… and the module author is always on-call 🙂
This is a simple example which will append some text to all elements named “article”: