ArmchairDissident has asked for the wisdom of the Perl Monks concerning the following question:
But for the life of me, I can't get these classes working in a module; I can only get them working in an application using them directly (i.e. copy and paste into each perl script that needs them). I've tried everything I know, and I'm feeling strangely ignorant. I've tried putting them into a series of .pm files in a hierarchy and usingpackage foo; sub new { ... } sub someOtherFunction { ... } package bar; sub new { ... } sub someOtherFunction { ... } package baz; sub new { ... } sub someOtherFunction { ... }
Which not only seems terribly wasteful, it doesn't solve the problem. Is it possible to declare and use more than one public class in a module? If so, how on earth does one do it? In other words: How do I set up foo, bar, and baz to be classes in the same namespace??use test::foo; use test::bar; use test::baz;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Multiple classes in modules
by ikegami (Patriarch) on Oct 05, 2004 at 19:00 UTC | |
by johnnywang (Priest) on Oct 05, 2004 at 20:06 UTC | |
by ikegami (Patriarch) on Oct 05, 2004 at 20:16 UTC | |
|
Re: Multiple classes in modules
by chromatic (Archbishop) on Oct 05, 2004 at 19:07 UTC | |
|
Re: Multiple classes in modules
by dragonchild (Archbishop) on Oct 05, 2004 at 18:57 UTC | |
|
Re: Multiple classes in modules
by Anonymous Monk on Oct 05, 2004 at 19:27 UTC |