in reply to Update XML data with Perl
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>
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Update XML data with Perl
by geekman (Initiate) on May 02, 2009 at 15:00 UTC | |
by Your Mother (Archbishop) on May 06, 2009 at 20:19 UTC | |
by geekman (Initiate) on May 02, 2009 at 15:08 UTC |