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 16:23:26-08 by gaetan in response to 3999
Re: :Init attribute and OIO::Args exception
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
Direct Responses: Write a response