Hi Tim & Elizabeth --
Regarding this (very interesting!) conversation, I think I just had a
"moment of clarity" about which I'm interested in your feedback.
A while back, Elizabeth wrote this:
> My original idea was for the base class to look
> something like this:
>
> subroutine run {
> my $rm_output = action();
> return output( $rm_output );
> }
>
> where action() was a (private?) subroutine that invoked the correct
run_mode
> call and output() formatted and printed the output. In this way the
current
> implementation of run is not altered in the least - just modularized a
> little.
Instead of putting this in the run() method, what if you created a single
run-mode which ran your entire application? Call it "ubermode":
sub setup {
my $self = shift;
$self->run_modes(
'ubermode' => \&ubermode
);
$self->start_mode('ubermode');
}
sub ubermode {
my $self = shift;
my $rm_output = $self->action();
return $self->output( $rm_output );
}
## Private methods ##
sub action {
my $self = shift;
my $action_output;
# invoke the correct run_mode call
return $action_output;
}
sub output {
my $self = shift;
my $output_output;
# format and print the output
return $output_output;
}
Would this not do exactly what you want?
-Jesse-
----
Jesse Erlbaum, CTO
Vanguard Media
212.242.5317 x115
[EMAIL PROTECTED]
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]