|
Oups,
Sorry, but I mix up problems
The previous code is running correctly
This code
package toto;
use strict;
use warnings;
use Object::InsideOut;
my @attr1
:Field;
my %_init_args :InitArgs = (
'attr1' => {
'field' => \@attr1,
'regex' => qr/attr1/,
'mandatory' => 1,
'preprocess' => \&toto::_verify_attr1
}
);
sub _verify_attr1
{
my (undef, undef, undef, $obj, $value) = @_;
OIO::Args->die('error' => 'Wrong usage',
'Usage' => 'This usage',
'ignore_package' => __PACKAGE__);
return $value;
}
package main;
toto->new('attr1' => 'val1');
1;
raises the OIO::Code exception.
I was intuitively waiting for an OIO::Args exception.
Would it be possible to modify the subroutine _args from InsideOut.pm so that OIO raised exception are rethrown (instead of raising a OIO::Code exception) ?
Again, sorry for my confusing previous post
Gaetan
|