yoreek / XML-Hash-XS

Convert hash to xml
Other
4 stars 4 forks source link

spaces are causing problems #3

Closed phillup closed 9 years ago

phillup commented 9 years ago

I could not get the xml2hash sample you gave to work with this code:

my $xml = <<'XML';
    <root>
       <item1>111</item1>
       <item2>222</item2>
       <item3>333</item3>
    </root>
XML

I had a peek at your unit tests and got one of them that was similar to work. Eventually I figured out that having a space for the first character was the culprit.

For example: say Dumper(xml2hash(' <root>boom</boom>'));

will result in a "Can't open file" error.

Likewise, the here doc above won't work unless the first line is justified against the left column.

yoreek commented 9 years ago

Thanks for report. I have improved XML detection in v0.39

phillup commented 9 years ago

Wow, that was fast (just like the module)... thanks!