title: Why I am getting: Undefined subroutine
body: <p>I am trying to move existing perl files to a new server and I am getting an error (error_log file). It work on the old server.</p>
  
  <p>When I access to: <a href="http://2x.29.xx.xx/admin/web.pl" rel="nofollow">http://2x.29.xx.xx/admin/web.pl</a></p>
  
  <p>I get an error:</p>
  
  <blockquote>
    <p>[error] Undefined subroutine &amp;web_main::main called at
    /var/www/path/web.pl line 40.</p>
  </blockquote>
  
  <p><strong>web.pl</strong> file, it look something like this:</p>
  
  <pre><code>#!/usr/bin/perl -w
  
  use strict;
  use warnings;
  
  use lib '/var/www/web';
  
  our $var = '/var/www/web';
  our $var1; 
  our $var2; 
  use web_main qw($var $var1 $var2);
  
  web_main::main();  # Line 40
  </code></pre>
  
  <p><strong>web_main.pm</strong> file (in /var/www/web), look something like this:</p>
  
  <pre><code>#!/usr/bin/perl -w
  
  package web_main;
  
  use strict;
  use warnings;
  
  sub main
  {
  
    # Lots of code here... removed for brevity
  }
  </code></pre>
  
  <p>Not sure what went wrong?</p>