package Foo; use strict; use warnings; package Foo::Bar; use strict; use warnings; sub foo { print 'foo'; } return 1; #### use Foo; use strict; use warnings; Foo::Bar->foo; #### package Foo; use strict; use warnings; our $AUTOLOAD; sub AUTOLOAD { my $self = shift; my $class = ref($self) || $self; my $name = $AUTOLOAD; print "$name in $class\n"; } package Foo::Bar; use strict; use warnings; use Exporter; our @ISA = qw(Foo); sub foo { print "foo\n"; } return 1; #### use Foo; use strict; use warnings; Foo::Bar->foo; Foo->bar; Foo::Bar->bar;