On Fri, 28 Sep 2001 08:45, Tim Colson wrote:
[snip]
>The problem I'm having is how to specify a reference to the workhorse
>subroutine inside the action - called doPerform().
>
>-----
>package JobAgent;
>use base 'PerlAppFramework';
>
>use ActionShowList;
>my $action = new ActionShowList( $self->query() );
>
> $self->run_modes(
> 'mode1' => \&showform,
> 'mode2' => \{$action->doPerform()} # naive attempt which barfs
> );
You should be able to do that with a closure, but make sure you read up on
anonymous subroutines and closures so that you know exactly what is
happening.
Something along the lines of this (untested) bit of code should do it:
'mode2' => sub {$action->doPerform()}
Cees Hek
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]