Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re^2: any way to fill calling namespace with a "use Module"?

by blue_cowdawg (Monsignor)
on Feb 23, 2013 at 21:56 UTC ( #1020345=note: print w/ replies, xml ) Need Help??


in reply to Re: any way to fill calling namespace with a "use Module"?
in thread any way to fill calling namespace with a "use Module"?

Wow! I didn't think of using BUILD that way. That's exactly what I'm looking for. (I'll write an experiment for this) Do you have to invoke use SubordinateA; use SubordinateB; in the invoking environment or ??? I suppose I can work around that...


Peter L. Berghold -- Unix Professional
Peter -at- Berghold -dot- Net; AOL IM redcowdawg Yahoo IM: blue_cowdawg


Comment on Re^2: any way to fill calling namespace with a "use Module"?
Select or Download Code
Re^3: any way to fill calling namespace with a "use Module"?
by tobyink (Abbot) on Feb 23, 2013 at 22:54 UTC
    my $class = "Subordinate" . $self->letter; Class::Load::load_class($class);

    Class::Load is a dependency of Moose, so you're already using it.

    package Cow { use Moo; has name => (is => 'lazy', default => sub { 'Mooington' }) } say Cow->new->name

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others drinking their drinks and smoking their pipes about the Monastery: (13)
As of 2015-07-02 10:00 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (33 votes), past polls