Subject: | error in isa validation |
use strict;
use warnings;
use CGI;
my %hash;
$object->set_foo(\%hash);
# error: Can't call method "isa" on unblessed reference at ...
# It looks like an Params::Validate internal error but the user used
the false API. Otherside the user get an error like parameter #2 ...
# Why isa validation don't check object before? Have I to write type
=> OBJECT and isa => CGI?
$object->set_foo(CGI->new(), \%hash);
# ok
package Foo;
sub new {
return bless {}, shift;
}
sub set_foo {
my ($self, $cgi_object, $hash) = validate_pos(
@_,
{type => OBJECT},
{isa => 'CGI'},
{type => HASHREF},
);
# and so on
}