Hello folks,
Sorry for the slightly off-topic post, but I have a question
about some code in the ValidateRM plugin, which is implemented as
a mix-in for CGI::Application.
In the ValidateRM plugin, this expression appears in the
check_rm() method (lines 59-65):
if (wantarray) {
# We have to call the function non-traditionally to achieve mix-in
happiness.
return $r, dfv_error_page($self);
}
else {
return $r;
}
Can anyone explain why dfv_error_page can't be called using the
standard method invocation syntax ($self->dfv_error_page)? The
comment seems to imply this doesn't work.
There was some discussion previously about problems calling private
methods in a mix-in class:
http://comments.gmane.org/gmane.comp.lang.perl.modules.cgi-appplication/3570?set_blog_all=yes
But in the case of ValidateRM, the dfv_error_page() method is
exported by default, so there shouldn't be a case where you can't
call that method on $self. Is this calling style:
some_method($self)
a standard convention to use to protect against the case where
some_method() may not be available to the calling class?
Thanks,
-E
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]