$ cat My/Own/Package.pm package My::Own::Package; sub foo { 'in My::Own::Package' } package My::Other::Package; sub foo { 'in My::Other::Package' } 1; $ ls My/Other/* ls: My/Other/*: No such file or directory $ cat print_foo.pl #!/usr/bin/perl use warnings; use strict; use lib qw(.); use My::Own::Package; print "calling My::Own::Package::foo() returns: " . My::Own::Package::foo() . "\n"; print "calling My::Other::Package::foo() returns: " . My::Other::Package::foo() . "\n"; $ print_foo.pl calling My::Own::Package::foo() returns: in My::Own::Package calling My::Other::Package::foo() returns: in My::Other::Package
In reply to Re: Packages and Modules
by repellent
in thread Packages and Modules
by Sary
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |