> 
> I did this shell command
> 
> perl -e 'use XML::Simple qw(:strict); use Data::Dumper; print
> Dumper(XMLin("<xxx><_a>b</_a></xxx>", 'ForceArray' => 1, KeyAttr =>
[]))' >
> delete.txt
> 
> And the output was
> 
> $VAR1 = {
>           '__a' => [
>                      'b'
>                    ]
>         };
> 
> I was aspecting 
> 
> $VAR1 = {
>           '_a' => [
>                      'b'
>                   ]
>         };
> 
> What am I doing wrong?
> 

I suspect XML::Simple thinks your XML is not well formed because your
tag names start with an underscore.  See point #2 here:

http://search.cpan.org/~grantm/XML-Simple-2.11/lib/XML/Simple.pm#Caveats

Which essentially gives it artistic license to do what it wants. Whether
this is a bug or just "you shouldn't do that it is bad for your health"
is hard to say...

In addition on my Perl 5.8.0, XML::Simple 2.0.7 on RH Linux 9, and in
Perl 5.6.1, XML::Simple 2.0.5, on Solaris 8, I get the output you expect.

http://danconia.org

-- 
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to