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-26 15:24:40-08 by gaetan
Extra parameter in new constructor
Hello all
If I execute the following program
package Foo; use strict; use warnings; use Object::InsideOut; my @attr :Field ; package main; my $obj = Foo->new('forbidden_attribute' => 'is accepted'); print $obj; 1;
No exception is raised
I didn't find any information about the correct behavior in the POD documentation
Could the OIO module raise an exception in such a situation ?
Thanks
Gaetan
Direct Responses: 4172 | Write a response
Posted on 2007-01-26 17:35:23-08 by jdhedden in response to 4167
Re: Extra parameter in new constructor
You only get an error if you're missing a mandatory arg, or if you supply an optional arg (as specified in an :InitArgs hash) without a 'Field' designation and without an :Init subroutine.

There's just no way to generally tell which parameters are used by which classes and in what manner. Further, if a class has no :Args or :InitArgs but does have :Init, then it gets all args.
Direct Responses: Write a response