>From CGI::Application:
sub run {
my $self = shift;
my $q = $self->query();
my $rm_param = $self->mode_param() || croak("No rm_param() specified");
my $rm;
# Support call-back instead of CGI mode param
if (ref($rm_param) eq 'CODE') {
# Get run-mode from subref
$rm = $rm_param->($self);
} else {
# Get run-mode from CGI param
$rm = $q->param($rm_param);
}
...
Idiom in question:
# Get run-mode from subref
$rm = $rm_param->($self);
Is there a word for this idiom in the object oriented programming world - where
an object calls a method on itself and passes a reference to itself to that
method? It seems like a kind of recursion. It would help me to have a label
for this brain twister. :)
Thanks!
Bill Catlan
---------------------------------------------------------------------
Web Archive: http://www.mail-archive.com/[email protected]/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]