I wanted to build an awesome place for people to discuss module specific issues, but I don't have any more time for this, and there are much better places to discuss Perl-related issues. I'd recommend asking your question on Stack Overflow or on Perl Monks.
If you are looking for a Perl tutorial or Perl-related news, I hope these links will serve you well.
Posted on 2007-01-09 15:42:22-08 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 2007-01-09 21:20:42-08 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.
Direct Responses: Write a response