note
aitap
<p>What exact problems do you have with these modules?</p>
<p>[doc://use] just makes <c><ModuleName>.pm</c> file from [doc://@INC] be evaluated at the beginning of program ([http://stackoverflow.com/questions/3998619/what-is-the-role-of-the-begin-block-in-perl|BEGIN{} block]). <c><ModuleName>.pm</c> can define any packages it wants to, but it's not a common way of writing modules.</p>
<p>So, if MyModule.pm contains this code:
<c>
package NotMyModule;
sub function { 1 }
</c>
you can use its functions in your program by calling them by package names, not by the name of the file:
<c>
use MyModule;
NotMyModule::function;
</c></p>
<p>By the way, one file can define more than one package, thus making [mod://fatpack|fatpacking] modules in an application possible.</p>
<!-- Node text goes above. Div tags should contain sig only -->
<div class="pmsig"><div class="pmsig-980564">
Sorry if my advice was wrong.
</div></div>
1014776
1014776