#!/usr/bin/perl -w
use Foo ;
use Goo ;
use Biz ;
use Baz ;
eval {
&testfoo ;
} ;
warn $@ if $@ ;
eval {
&testgoo ;
} ;
warn $@ if $@ ;
eval {
&testbiz ;
} ;
warn $@ if $@ ;
eval {
&testbaz ;
} ;
warn $@ if $@ ;
####
package Foo ;
use base qw(Class::DBI) ;
use vars qw(@ISA @EXPORT) ;
require Exporter ;
push @ISA, qw(Exporter) ;
@EXPORT = qw/testfoo/ ;
sub testfoo {
print "It works\n" ;
}
####
package Goo ;
use base qw(Class::DBI) ;
use vars qw(@ISA @EXPORT) ;
require Exporter ;
unshift @ISA, qw(Exporter) ;
@EXPORT = qw/testgoo/ ;
sub testgoo {
print "It works\n" ;
}
1 ;
####
package Biz ;
use base qw(CGI) ;
use vars qw(@ISA @EXPORT) ;
require Exporter ;
push @ISA, qw(Exporter) ;
@EXPORT = qw/testbiz/ ;
sub testbiz {
print "It works\n" ;
}
1 ;
####
package Baz ;
use base qw(CGI) ;
use vars qw(@ISA @EXPORT) ;
require Exporter ;
unshift @ISA, qw(Exporter) ;
@EXPORT = qw/testbaz/ ;
sub testbaz {
print "It works\n" ;
}
1 ;
####
$ perl test.pl
It works
It works
Undefined subroutine &main::testbiz called at test.pl line 19.
It works
####
[mcdave@maia ~]$ uname -a
Linux maia 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[mcdave@maia ~]$ perl -v
This is perl, v5.8.8 built for x86_64-linux-thread-multi
...
[mcdave@maia ~]$ perl -MExporter -e 'print $Exporter::VERSION, "\n"'
5.63
[mcdave@maia ~]$ perl -MCGI -e 'print $CGI::VERSION, "\n"'
3.15
[mcdave@maia ~]$ perl -MClass::DBI -e 'print $Class::DBI::VERSION, "\n"'
3.0.17
[mcdave@maia ~]$ perl test.pl
Undefined subroutine &main::testfoo called at test.pl line 9.
It works
Undefined subroutine &main::testbiz called at test.pl line 19.
It works
####
[mcdave@trowel ~]$ uname -a
Linux trowel 2.6.18-164.el5 #1 SMP Tue Aug 18 15:51:48 EDT 2009 x86_64 x86_64 x86_64 GNU/Linux
[mcdave@trowel ~]$ perl -v
This is perl, v5.8.8 built for x86_64-linux-thread-multi
...
[mcdave@trowel ~]$ perl -MExporter -e 'print $Exporter::VERSION, "\n"'
5.58
[mcdave@trowel ~]$ perl -MCGI -e 'print $CGI::VERSION, "\n"'
3.15
[mcdave@trowel ~]$ perl -MClass::DBI -e 'print $Class::DBI::VERSION, "\n"'
3.0.17
[mcdave@trowel ~]$ perl test.pl
It works
It works
Undefined subroutine &main::testbiz called at test.pl line 19.
It works