Subject: | get_hook not called with default new() |
Date: | Wed, 22 Jul 2009 22:25:27 -0500 |
To: | bug-Class-InsideOut [...] rt.cpan.org |
From: | Jay Strauss <me [...] heyjay.com> |
Hi, I believe there is a bug when using the "default" new method, in that it
does not call the get_hook routine while setting attributes. In the example
below, when calling the constructor the get_hook is not executed for the
attribute being set. But if I call the setter for that attribute the
get_hook does get executed:
package My::Test;
use Class::InsideOut qw(:all);
public symbol => my %symbol, { set_hook => \&_populate };
sub _populate {
my $self = shift;
print "in _populate: ",$self,"\n";
}
1;
my $test = My::Test->new(symbol=>"DELL");
$test->symbol("IBM");
Thanks
Jay