You can use XML::Simple not only to read XML, but also to write it back. Though I can't say it's so simple ;)
use strict; use warnings; use XML::Simple; my $xml = '<xml> <computers> <os>Unix</os> </computers> </xml>'; my $ref = XMLin($xml); $ref->{computers}{os} = 'Solaris'; $xml = XMLout( $ref, RootName => 'xml', NoAttr => 1, NoIndent => 1 ); print "$xml\n"; __END__ <xml><computers><os>Solaris</os></computers></xml>
In reply to Re: Update XML data with Perl
by zwon
in thread Update XML data with Perl
by geekman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |