#!/usr/bin/perl use strict; use warnings; use Data::Dumper; use XML::Simple qw(:strict); my $file = <DATA>; my $ref = XMLin($file, KeyAttr => {item => 'firstname'}, ForceArray => [ 'item' ], ContentKey => '-content' ); print Dumper($ref); __DATA__ <opt> <person key="jsmith" firstname="Joe" lastname="Smith" /> <person key="tsmith" firstname="Tom" lastname="Smith" /> <person key="jbloggs" firstname="Joe" lastname="Bloggs" /> </opt>
In reply to Re: error from XML::Simple
by Khen1950fx
in thread error from XML::Simple
by DavidFerrington
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |