Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

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

by tobyink (Abbot)
on Feb 23, 2013 at 22:54 UTC ( #1020356=note: print w/ replies, xml ) Need Help??


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

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


Comment on Re^3: any way to fill calling namespace with a "use Module"?
Download Code

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others romping around the Monastery: (12)
As of 2014-12-18 22:30 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    Is guessing a good strategy for surviving in the IT business?





    Results (67 votes), past polls