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 2005-11-18 20:20:58-08 by earl
Type with no Accessors
I have a module that uses the latest version of Object::InsideOut (v1.11). The module has the following declaration.
my @f :Field('Type' => 'HASH');
When I try testing the module, I get the following error message:
OIO::Attribute error: Accessor name missing in :FIELD attribute in package ... Info: Need 'GET', 'SET' or 'ACCESSOR' designator Attribute: Field( 'Type' =&gt 'HASH')
Removing 'Type' => 'HASH' or Adding 'Get' => 'xxx' makes the error go away. Why is it an error to have a Type without a Get? Whenever I call ->set (the internal setter), I would like the value type checked.
Direct Responses: 1352 | Write a response
Posted on 2005-11-18 22:03:48-08 by jdhedden in response to 1351
Re: Type with no Accessors
The arguments to the :Field attribute are solely for the purpose of generating accessors. The purpose of the 'Type' argument is for adding type-checking code to the 'set' accessor.

When you put the 'Type' argument in, you triggered the code that generates accessors. That, in turn, complained about not finding an accessor name.

I suppose I should also make something like :Field('get' => 'name', 'type' => 'list') an error, as well, as 'Type' makes no sense without 'Set'.

Thanks for bring this to my attention. I'll work on making the POD a bit more clear.
Direct Responses: Write a response