Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: Module's name and file's name

by aitap (Deacon)
on Jan 22, 2013 at 20:37 UTC ( #1014784=note: print w/ replies, xml ) Need Help??

in reply to Module's name and file's name

What exact problems do you have with these modules?

use just makes <ModuleName>.pm file from @INC be evaluated at the beginning of program (BEGIN{} block). <ModuleName>.pm can define any packages it wants to, but it's not a common way of writing modules.

So, if contains this code:

package NotMyModule; sub function { 1 }
you can use its functions in your program by calling them by package names, not by the name of the file:
use MyModule; NotMyModule::function;

By the way, one file can define more than one package, thus making fatpacking modules in an application possible.

Sorry if my advice was wrong.

Comment on Re: Module's name and file's name
Select or Download Code
Replies are listed 'Best First'.
Re^2: Module's name and file's name
by beurive.denis (Novice) on Jan 22, 2013 at 20:53 UTC

    Hello Aitap,

    I just add a new message that describes the problem.

    But I have not many details to give. I though that the problem came from the naming convention... I did not look further.

    I'll look tomorrow, if I have some time.



Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1014784]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others perusing the Monastery: (11)
As of 2015-11-30 15:37 GMT
Find Nodes?
    Voting Booth?

    What would be the most significant thing to happen if a rope (or wire) tied the Earth and the Moon together?

    Results (774 votes), past polls