You can use XML::Simple to do modifications too:
Update:'KeepRoot' was added in according to AM's comments below.use XML::Simple; my $inst_set = XMLin( 'test.xml', KeepRoot => 1 ); foreach my $Channel (@{$inst_set->{Settings}->{Channels}->{Channel}}) +{ if ( $Channel->{Voltage} ) { print "Old voltage: $Channel->{Voltage} -- "; $Channel->{Voltage} *= 2.0; print "New voltage: $Channel->{Voltage}\n"; } } my $xml = XMLout( $inst_set, KeepRoot => 1 ); print $xml;
In reply to Re: confirming key in xml?
by pme
in thread confirming key in xml?
by ccherri
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |