metaperl has asked for the wisdom of the Perl Monks concerning the following question:
I'm curious (after searching the FAQ and this site) how to force such an element to an empty string:
use XML::Simple; my $xml=<<'EOXML'; <config logdir="/var/log/foo/" debugfile="/tmp/foo.debug"> <groups></groups> <age>18</age> <weight>220</weight> </config> EOXML my $xs = XML::Simple->new; my $ref = $xs->XMLin($xml); use Data::Dumper; warn Dumper($ref);
[tbrannon@devel tmp]$ perl xml-simple.pl $VAR1 = { 'debugfile' => '/tmp/foo.debug', 'weight' => '220', 'groups' => {}, #### <---- want empty string here! 'age' => '18', 'logdir' => '/var/log/foo/' };
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: XML::Simple - forcing empty elements to empty string?
by ikegami (Patriarch) on Jun 16, 2009 at 13:20 UTC | |
|
Re: XML::Simple - forcing empty elements to empty string?
by Anonymous Monk on Jun 16, 2009 at 13:27 UTC |