When I try this, I get "Can't locate test2.pm in @INC".
My main file is called "test.pl", and the second file with the subroutine in it is called "test2.pl".
Here is "test.pl":
#!/usr/bin/perl -wT
$|=1;
print "Content-type: text/html\n\n";
use CGI::Carp('fatalsToBrowser');
use strict;
use warnings;
use CGI qw(:standard);
use test2;
$CGI::DISABLE_UPLOADS = 1;
$CGI::POST_MAX = 51_200;
$|=1;
print header( "text/html" ),
start_html(-title => "Hello World");
test2::hello();
print end_html();
Here is "test2.pl":
#!/usr/bin/perl -wT
package test2;
sub hello {
print "HELLO!\n";
}
1;
Is this something with the way my web server is setup that it doesn't allow multiple files or is it just a code problem? Thanks in advance. |