- or download this
<opt>
<trans>
<idnumber1 status="not contacted" assignee="jack" />
</trans>
</opt>
- or download this
<opt>
<trans>
...
<idnumber2 status="contacted" assignee="jill" />
</trans>
</opt>
- or download this
<opt>
<trans>
<item id="1" status="not contacted" assignee="jack" />
</trans>
</opt>
- or download this
<opt>
<trans>
...
<item id="2" status="contacted" assignee="jill" />
</trans>
</opt>
- or download this
my $xs = XML::Simple->new(
forcearray => [ 'item' ],
...
);
my $opt = $xs->XMLin(\*DATA);
- or download this
$opt->{trans}->{item}->{1}
- or download this
$opt->{trans}->{item}->{2} = { status => 'contacted', assignee => 'j
+ill' };
- or download this
#!/usr/bin/perl -w
...
<item id="1" status="not contacted" assignee="jack" />
</trans>
</opt>
- or download this
$opt->{trans}->{item}->[0]
- or download this
@{ $opt->{trans}->{item} }
- or download this
my $id = @{ $opt->{trans}->{item} } + 1;
push @{ $opt->{trans}->{item} }, { id => $id, status => 'contacted',
+ assignee => 'jill' };
- or download this
#!/usr/bin/perl -w
...
<item id="1" status="not contacted" assignee="jack" />
</trans>
</opt>