How to call post-constructor automatically

[email protected] (Yuri Shtil)
Newsgroups perl.moose
Message-ID <[email protected]>
Hi all,

Let's assume we have a hierarchy of classes:

package Top;
use Moose;
...

package One;
use Moose;
extends 'Top';
....

package Two;
use Moose;
extends 'One';
....


I want to be able to call a method (let's say post_constructor) after 
the object Two has been created:

my $obj = Two->new(...).
$obj->post_constructor().

The trick is I want the method be called implicitly as a part of new.
It is almost as having a hidden subclass of Two with a call to 
post_constructor in its BUILD method.

I hope I was able to explain what I'm looking for.


-- 

Yuri
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.