Roles and BUILD

2005-05-16 Thread Ingo Blechschmidt
Hi, are Roles allowed to contain submethods and does especially the BUILD submethod work as I presume in the following code? class IRC::Bot { has Array %:handler; method add_handler(Str $event, Code $callback) { push %:handler{$event}: $callback; } ...;

Re: Roles and BUILD

2005-05-16 Thread Larry Wall
On Mon, May 16, 2005 at 03:10:10PM +, Ingo Blechschmidt wrote: : my MyBot $bot .= new; : # Are IRC::Bot::JoinOnInvite::BUILD and : # IRC::Bot::SayHelloOnJoin::BUILD called? Yes, role BUILD submethods are magically composed into the class's BUILD method somehow (or at least called at

Re: Roles and BUILD

2005-05-16 Thread Brent 'Dax' Royal-Gordon
On 5/16/05, Larry Wall [EMAIL PROTECTED] wrote: Yes, role BUILD submethods are magically composed into the class's BUILD method somehow (or at least called at the appropriate time). Could this be a feature of all submethods, not just BUILD? (DESTROY, for instance, would need it too...) --