Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Module's name and file's name

by sundialsvc4 (Abbot)
on Jan 23, 2013 at 19:57 UTC ( #1015011=note: print w/replies, xml ) Need Help??

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

It is my understanding that the names should agree because Perl looks for module-files by matching the file name.   It reads whatever it finds, of course expecting that the desired package-name will be defined thereby.

However, the formal purpose of the package directive is to introduce a namespace, and once Perl has been cajoled into reading a source-file, it will of course recognize all of the package (namespace) names found therein.   Sometimes there are very good, even compelling, reasons to do just that ... for instance, when you are defining grammars for Parse::RecDescent (and I don’t know offhand if it is strictly necessary ...), or when you simply have a group of classes that you know will always be used together to help one another out.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1015011]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others taking refuge in the Monastery: (7)
As of 2018-05-21 11:55 GMT
Find Nodes?
    Voting Booth?