hakana has asked for the wisdom of the Perl Monks concerning the following question:
using KeyAttr => 'tc' to read the xmlfile and tried something like:<exec> <tc id="001.001" version=""> </tc> </exec>
Is there a better way to find the specific tc (id) of interest? How shall I add the other attributes to that item?foreach my $tc (@{$xml->{tc}}) { if ($tc->{id} eq '001.001') { $xml->{tc}{version => '...'}; }; } }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple find and add
by reasonablekeith (Deacon) on Dec 05, 2007 at 10:59 UTC |