Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: Module's name and file's name

by dsheroh (Parson)
on Jan 23, 2013 at 11:09 UTC ( #1014881=note: print w/ replies, xml ) Need Help??


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

So long as you remember to refer to things using the correct package name (HR::myFunction) rather than the file name (MyModule::myFunction), the only technical issue is that symbols exported by the package won't work automatically. If it exports anything, you'll have to manually call HR->import; after you use MyModule; because the automatic call to MyModule->import; won't do anything.

Even though it doesn't cause technical problems, it does tend to cause major usability and maintenance problems, so, as a general rule, it shouldn't be done except in very limited circumstances. A package named HR in a file named MyModule.pm is not one of those circumstances.


Comment on Re: Module's name and file's name
Select or Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others contemplating the Monastery: (7)
As of 2015-07-28 08:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (254 votes), past polls