Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?

Re: Moose: apply Role at Runtime (build vs. default)

by tobyink (Abbot)
on Apr 02, 2013 at 16:13 UTC ( #1026729=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download

  1. or download this
    use v5.14;
    use strict;
    my $obj = "MyObject"->new;
    Moose::Util::apply_all_roles($obj, "MyRole");
    say $obj->myattr;
  2. or download this
    # Not this...
    default => \&_build_myattr,
    # This!
    default => sub { shift->_build_myattr(@_) },

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1026729]
[Discipulus]: you are rigth, gory details but i remember from dunnowhere that concetrate caffein is more effective than brown water almost coffe..
[LanX]: prepared both kinds a 100 times and thinks the amount of grind code is about the same
Discipulus less effective i mean
[LanX]: (french press vs espresso cooker )
[LanX]: s/code/coffee/
Discipulus progammer is an organism that transforms caffeine into software..
[LanX]: hmm interesting link

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (8)
As of 2017-01-16 11:01 GMT
Find Nodes?
    Voting Booth?
    Do you watch meteor showers?

    Results (149 votes). Check out past polls.