Beefy Boxes and Bandwidth Generously Provided by pair Networks
"be consistent"
 
PerlMonks  

Re: Perl Modules with 2 or more classes

by anneli (Pilgrim)
on Oct 19, 2011 at 10:44 UTC ( #932355=note: print w/ replies, xml ) Need Help??


in reply to Perl Modules with 2 or more classes

Not as such; Perl modules are classes (if you so choose to use them that way, c.f. bless). If you need different kinds of objects, you might want to nest some of them in sub-packages. Below disclaimer fulfilled, I forgot all about Moose and/or other object systems!

Disclaimer: my Perl OOP-fu is weak.


Comment on Re: Perl Modules with 2 or more classes
Re^2: Perl Modules with 2 or more classes
by dsheroh (Parson) on Oct 20, 2011 at 10:20 UTC
    Moose and/or other object systems have nothing to do with it. The relation between packages (classes) and files is purely a convention born of convenience. There's absolutely nothing stopping you from putting multiple packages into a single file or splitting a single package across multiple files while using only the core language. It messes with use (which assumes that the file name and package name will be identical) and can thoroughly confuse anyone trying to read/maintain the code in the future, but that's about it.

      Good points. Thank you!

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (9)
As of 2014-07-25 09:42 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    My favorite superfluous repetitious redundant duplicative phrase is:









    Results (170 votes), past polls