Hi,
I have the xml file and i readed that xml file and i created hash table. now i need to create one module that i can call from main function.in my main function path is the input and it returns hash as the output.so now i need to create one module for my code below,
Code:
#!/usr/bin/perl
use warnings;
use strict;
use XML::LibXML::Reader;
#Reading XML with a pull parser
my $file;
open( $file, 'formal.xml');
my $reader = XML::LibXML::Reader->new( IO => $file ) or die ("unable to open file");
my %nums;
while ($reader->nextElement( 'Data' ) ) {
 
my $des = $reader->readOuterXml();
 
$reader->nextElement( 'Number' ); 
my $desnode = $reader->readInnerXml(); 
 
$nums{$desnode}= $des;
print( " NUMBER: $desnode\n" );
print( " Datainfo: $des\n" );
}