If the file name is MyTest.pm, just do use MyTest or BEGIN { require "MyTest.pm"; } (subbtle differences left to you to lookup). use doesn't care what packages are used inside the file. For example,
use Bah looks for Bah.pm, and
use Foo::Bar looks for Foo/Bar.pm,
even if they contain packages
Cow::Moo,
Cow::Eat and
Milkmaid.
perl looks for the modules in the the paths listed in @INC. See use lib for a method to edit @INC.
In reply to Re: Multiple classes in modules
by ikegami
in thread Multiple classes in modules
by ArmchairDissident
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |