package My::Module;
BEGIN {
use Exporter ();
use vars qw(@ISA @EXPORT @EXPORT_OK);
@ISA = qw(Exporter);
@EXPORT = qw();
@EXPORT_OK = qw(testsub);
}
use strict;
use Apache::Reload;
sub testsub {
return "module subroutine";
}
1;
####
#!/usr/bin/perl
use My::Module;
My::Module->import(qw(testsub));
print testsub(), "\n";
sub testsub { # "local" definition of subroutine
return "local subroutine";
}
####
<% $txt %>
<%INIT>
use My::Module;
My::Module->import(qw(testsub));
my $txt = testsub();
%INIT>
####
PerlInitHandler Apache::Reload
PerlSetVar ReloadAll Off
####
use Apache::Reload;