in reply to Modify XML

Try XML::XPath
use XML::XPath; use strict; use warnings; my $xml = do {local $/; <DATA>}; my $xp = XML::XPath->new( xml => $xml ); $xp->setNodeText('/XML/TestElement', 'Bye'); print $xp->findnodes_as_string('/'); __DATA__ <XML> <TestElement>Hello</TestElement> </XML>

Replies are listed 'Best First'.
Re^2: Modify XML
by perl@1983 (Sexton) on Apr 04, 2011 at 17:07 UTC
    Thanks. This is what I was looking for. What does the below line mean actually? print $xp->findnodes_as_string('/');