http://qs321.pair.com?node_id=930963


in reply to Re: number of keys and values in a hash
in thread number of keys and values in a hash

i tried like that as you said but i have one doubt

#!/usr/bin/perl use warnings; use strict; use XML::LibXML::Reader; my $file;open $file, 'formal.xml'); my $reader = XML::LibXML::Reader->new( IO => $file ) or die ("unable t +o open file"); while ( $reader->nextElement( 'DATA' ) ) { my $info = $reader->readOuterXml(); $reader->nextElement( 'number' ); my $number = $reader->readInnerXml(); $nums{$number}=$info; print( "num: $number\n" ); print( " datainfo: $info\n" }

it excuting but can i print hash directly not using

print( "num: $number\n" ); print( " datainfo: $info\n"
i tried like this
print %nums;
but it excuting infinity times. and also how to specify input path outside the module.