Re: Accessing object constructors from the 'main'
[email protected] (Lars Balker) Mon, 10 Jun 2013 23:32:02 +0200
| Newsgroups | perl.moose |
|---|---|
| Message-ID | <CAB-_BaQbNbvuNDGnfSxnK+dNJ-4JDRZPBi9LMQZ0xmVR7UT2cA@mail.gmail.com> |
Foo.pm: package Foo; use Moose; main.pl: use Foo; Foo->new; See "perldoc FindBin" and "perldoc lib" to help use find Foo.pm On Sat, Jun 8, 2013 at 9:26 AM, Faelin McCaley Landy <[email protected] > wrote: > The Moose::Manual is very well written, but is definitely lacking in > explanation of a very key step in product development: how on Earth do you > actually use your objects in a script?! > > Specifically, my problem is that I want to have a *main.pl* from which I > call *Obj->new( ... );* > What I can't figure out is how I'm supposed to do this from a different > file than the original *Obj* definition. Currently, I'm making it work by > >> *use Moose; >> extends 'Obj';* > > but this seems like it can't be the Best Practices way to go about is... > Is there a more "proper" way to access an objects constructor from a > different document? > > Thanks, > Faelin > -- Lars Balker Consult::Perl