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
i tried like thisprint( "num: $number\n" ); print( " datainfo: $info\n"
but it excuting infinity times. and also how to specify input path outside the module.print %nums;
In reply to Re^2: number of keys and values in a hash
by veerubiji
in thread number of keys and values in a hash
by veerubiji
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |