Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
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 pondering the Monastery: (18)
As of 2014-10-23 13:59 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    For retirement, I am banking on:










    Results (125 votes), past polls