- or download this
my $foo = Foo->new qw(
Foo::Bar
Foo::Baz
);
- or download this
my @submodules = @_;
for ( @submodules ) {
eval "require $_" || die "$!";
}
- or download this
my $foo = Foo->new qw(
Bar
Baz
);
- or download this
for ( @submodules ) {
eval "require Foo::$_" || die "$!";
}
- or download this
package Foo;
sub new {
...
bless { submodules => \@submodules }, $class;
}
1;
- or download this
package Foo::Bar;
sub details {
...
}
1;
- or download this
#!/usr/bin/perl
use Foo;
...
. $/;
}
# prints: Simon is a doctor
- or download this
package Foo;
sub new {
...
bless { submodules => \@submodules }, $class;
}
1;
- or download this
package Foo::Bar;
sub details {
...
}
1;
- or download this
#!/usr/bin/perl
use Foo;
...
}
# prints: Can't locate object method "details" via package "Bar"
# (perhaps you forgot to load "Bar"?)