Beefy Boxes and Bandwidth Generously Provided by pair Networks
No such thing as a small change
 
PerlMonks  

Re^4: Dynamically adding methods to Moo class

by McA (Priest)
on Apr 23, 2014 at 16:54 UTC ( #1083394=note: print w/ replies, xml ) Need Help??


in reply to Re^3: Dynamically adding methods to Moo class
in thread Dynamically adding methods to Moo class

Thank you, Tobyink. That's what I meant with "Or do I have to tweak with the symbol table?" in my initial question. I thought that this kind of functionality is somewhere accessible in a more "formal" manner. A kind of:

install_method('method_name', sub {});

Best regards
McA


Comment on Re^4: Dynamically adding methods to Moo class
Download Code
Replies are listed 'Best First'.
Re^5: Dynamically adding methods to Moo class
by Arunbear (Parson) on Apr 24, 2014 at 12:51 UTC
    Not part of Moo, but ...
    use Sub::Install; Sub::Install::install_sub({ code => sub { ... }, into => $package, as => $subname });
    Link: Sub::Install

Log In?
Username:
Password:

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

How do I use this? | Other CB clients
Other Users?
Others exploiting the Monastery: (10)
As of 2015-08-31 17:44 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The oldest computer book still on my shelves (or on my digital media) is ...













    Results (359 votes), past polls