http://www.perlmonks.org?node_id=1033324

derekstucki has asked for the wisdom of the Perl Monks concerning the following question:

I'm writing some code that retrieves a shipping rate quote in XML format. All I need from this XML tree ( 10-20KB in size ) is a single value from a node in the middle of it. The two approaches I've considered is parsing the tree with XML::LibXML, or running a very simple regex, along the lines of

/<specificParentNode>.*<nodeINeed>(\d+)</nodeINeed>/

Is there any reason why I should do the XML parser over the regex approach? My main reason for wanting to use the regex approach is ease of writing it.