title: module creation using perl script
body: <blockquote>
    <p><strong>Possible Duplicate:</strong><br>
    <a href="https://stackoverflow.com/questions/550831/how-do-you-create-a-perl-module">How do you create a Perl module?</a>  </p>
  </blockquote>
  
  
  
  <p>I have the script that reads an xml file and creates hash table. its working properly but now i need to create module for that code, that i can call in my main function.In my main function file path as input and it gives output as hash. now i need to create module for this code.</p>
  
  <pre><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-&gt;new( IO =&gt; $file ) or die ("unable to open file");
  my %nums;
  while ($reader-&gt;nextElement( 'Data' ) ) {
      my $des = $reader-&gt;readOuterXml();
      $reader-&gt;nextElement( 'Number' ); 
      my $desnode = $reader-&gt;readInnerXml(); 
      $nums{$desnode}= $des;
      print( " NUMBER: $desnode\n" );
      print( " Datainfo: $des\n" );
  }
  </code></pre>
  
  <p>how can i create module for this code?</p>