This is the test proggy:sub selftest(@){ my $self = _self(@_); print Dumper(@_); } sub _self(\@){ print Dumper(@_); if(ref($_[0]->[0]) && $_[0]->[0]->_me() eq 'DVALID'){ return shift(@{ $_[0] }); }else{ return; } }
This is the output:my $chk = new Data::Validate::OO( -failure => sub{ my $rule = shift; print "Error in rule '$rule': ". +join(', ',@_)."\n"; }, ); $chk->selftest(qw(This Is a Test of the emergency broadcast system!));
$VAR1 = bless( { '_error' => '', '_fail' => sub { "DUMMY" }, '_rules' => {} }, 'Data::Validate::OO' ); $VAR2 = 'This'; $VAR3 = 'Is'; $VAR4 = 'a'; $VAR5 = 'Test'; $VAR6 = 'of'; $VAR7 = 'the'; $VAR8 = 'emergency'; $VAR9 = 'broadcast'; $VAR10 = 'system!'; Not an ARRAY reference at OO.pm line 264.
Now, according to perlman:perlsub "Any backslashed prototype character represents an actual argument that absolutely must start with that character. The value passed as part of @_ will be a reference to the actual argument given in the subroutine call, obtained by applying \ to that argument." Reading this, it seems to me that I should be getting a reference to the @_ of the caller sub. Unfortunately that apparently isn't happening... unless I messed up somewhere else (which is quite possible).
If there is any more information you feel might help to solve the problem, please request it and I will do my best to take care of it.
Thank you.
My code doesn't have bugs, it just develops random features.
Flame ~ Lead Programmer: GMS | GMS
In reply to Prototype Failing? by Flame
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |