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.
I could not get the xml2hash sample you gave to work with this code:
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.