It worked for me after I removed the '%' character from my test xml. With that character included in a text node as shown below the parse function would hang. Perhaps you have some other special character that the XML::Mini::Document module can't handle.

use warnings; use strict; #use 5.24.1; use Data::Dumper qw(Dumper); use XML::Mini::Document; $Data::Dumper::Terse=1; my $xml_input; { local $/; $xml_input = <DATA>; } print "1********************************************\n"; print $xml_input; my $xml_object =XML::Mini::Document->new(); $xml_object->parse($xml_input); #goto END; my $hash_ref = $xml_object->toHash(); print "2********************************************\n"; print Dumper($hash_ref); my $dumped_hash=Dumper($hash_ref); my $evalled_hashdata=eval($dumped_hash); print "3********************************************\n"; print Dumper($evalled_hashdata); END: #exit; ## This will cause ->parse() to hang. ## <BitmapPath>%TEST_ROOT%\bitmaps\</BitmapPath> __DATA__ <?xml version="1.0" encoding="utf-8"?> <NetConfig> <UseServerTimer>false</UseServerTimer> <PhoneNumberRegex /> <InitializeStatistics_Logging>false</InitializeStatistics_Logging> <InitializeStatistics_Logging>false_test</InitializeStatistics_Loggi +ng> <InitializeStatistics_Logging>false test</InitializeStatistics_Loggi +ng> <InitializeStatistics_Logging>false test </InitializeStatistics_Logg +ing> <ViewerConfigs> <TileNamePatern>{0}\{1}\{2}.tile</TileNamePatern> <ViewerConfigWrap> <File>viewerConfigx.xml</File> <Name>FI_RT</Name> </ViewerConfigWrap> </ViewerConfigs> </NetConfig>

Here is the output:

1******************************************** <?xml version="1.0" encoding="utf-8"?> <NetConfig> <UseServerTimer>false</UseServerTimer> <PhoneNumberRegex /> <InitializeStatistics_Logging>false</InitializeStatistics_Logging> <InitializeStatistics_Logging>false_test</InitializeStatistics_Loggi +ng> <InitializeStatistics_Logging>false test</InitializeStatistics_Loggi +ng> <InitializeStatistics_Logging>false test </InitializeStatistics_Logg +ing> <ViewerConfigs> <TileNamePatern>{0}\{1}\{2}.tile</TileNamePatern> <ViewerConfigWrap> <File>viewerConfigx.xml</File> <Name>FI_RT</Name> </ViewerConfigWrap> </ViewerConfigs> </NetConfig> 2******************************************** { 'NetConfig' => { 'PhoneNumberRegex' => '', 'ViewerConfigs' => { 'ViewerConfigWrap' => { 'File' + => 'viewerConfigx.xml', 'Name' + => 'FI_RT' }, 'TileNamePatern' => '{0}\\{1}\ +\{2}.tile' }, 'InitializeStatistics_Logging' => [ 'false', 'false_test', 'false test', 'false test' ], 'UseServerTimer' => 'false' }, 'xml' => { 'version' => '1.0', 'encoding' => 'utf-8' } } 3******************************************** { 'NetConfig' => { 'PhoneNumberRegex' => '', 'UseServerTimer' => 'false', 'InitializeStatistics_Logging' => [ 'false', 'false_test', 'false test', 'false test' ], 'ViewerConfigs' => { 'TileNamePatern' => '{0}\\{1}\ +\{2}.tile', 'ViewerConfigWrap' => { 'File' + => 'viewerConfigx.xml', 'Name' + => 'FI_RT' } } }, 'xml' => { 'version' => '1.0', 'encoding' => 'utf-8' } }

In reply to Re: XML to Hash Truncating Keys Problem by Lotus1
in thread XML to Hash Truncating Keys Problem by Wayne

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.