Thread

Posted on Tue Jan 9 17:42:22 2007 by gaetan
:InitArgs attribute and type verification
Hello all
The following code does not work
package toto; use Object::InsideOut; my @attr1 :Field; my %_init_args :InitArgs = ( 'attr1' => { 'field' => \@attr1, 'regex' => qr/attr1/, 'mandatory' => 1, 'type' => \&toto::_verify_attr1 }); sub _verify_attr1 :Private { return 1; } package main; toto->new('attr1' => 'val1'); 1;
I obtain the following result:
("Can't call private method 'toto->_verify_attr1' ...")
InsideOut documentation on 'TYPE CHECKING' gives an working example (not using the InitArgs attribute) with a private method
What is wrong in my code ?
Thanks
Direct Responses: 4005 | Write a response
Posted on Tue Jan 9 23:20:42 2007 by jdhedden in response to 3998
Re: :InitArgs attribute and type verification
This is an oversight in the documentation. If used inside the :InitArgs hasn, the type checking subroutine cannot be made :Private. I've updated the docs for the next release. Thanks for pointing this out.
Write a response