This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
[perl #29230] Class::Struct, accessor overrides not called from constructor
authorRhesa Rozendaal <perl@rhesa.com>
Fri, 15 Jun 2012 16:39:13 +0000 (09:39 -0700)
committerFather Chrysostomos <sprout@cpan.org>
Fri, 15 Jun 2012 19:28:18 +0000 (12:28 -0700)
commita79a48c06297674602f44ec367c8b2768b1c997a
tree45f84905c39420ab2e944139b32ef3aab412fd90
parent84fde9b42e7c19995ec85ea8f148b482068f4228
[perl #29230] Class::Struct, accessor overrides not called from constructor

Class::Struct allows you to override the accessors it creates, but it
doesn't call them in its constructor.
In other words,

     $struct->field('blah');

calls my override, but

     $struct = structure->new('field' => 'blah');

doesn't. Class::Struct simply does

     $r->{'field'} = $init{'field'}

but it would be more useful if it did

     $r->field($init{'field'})
lib/Class/Struct.pm