All the books and forum about Perl Modules converge in saying this:
when you
use Some::Package;
Perl will look for Package.pm in directory tree ./Some/Package.pm
Sure, but...
The important thing that almost nobody has remembered to refer that, in the Package.pm, the first line must be
package Some::Package;
not
package Package;
if the package is not specified like that, you will undoubtedly receive error message saying that
"can't locate object method via package Some::Package ... perhaps you forgot to load Some::Package at use_some_package.pl line xx"
And here's the example



No comments:
Post a Comment