|
From: Victor P. <ope...@ha...> - 2001-12-12 20:24:17
|
Hi,
I wrote this handler that manages the purchasing process. It basically
checks that all the needed objects exist -- like user profile, a credit
card, etc., -- and calls appropriate action. For example, if there is no
user profile it calls up the handler for user profiles with the 'create'
task. Here's the gist of how I do it:
package OpenInteract::Handler::Purchase;
...
use OpenInteract::Handler::RegNasa;
@OpenInteract::Handler::Purchase::ISA = qw(
OpenInteract::GenericDispatcher
);
...
sub buy_stuff
{
if(!$profile)
{
return OpenInteract::Handler::RegNasa->handler({task => 'create'});
}
}
This seems to work fine actually. I just was wondering if there perhaps was
an interface to just run one of the actions I have defined in actions.perl
from within a handler -- without having to explicitly refer to the handler I
want to run. Seems it would be neater that way. Thanks.
-Victor
---
"Tatarsky, of course, hated most of the manifestations of Soviet power, but
he still couldn't understand why it was worth exchanging an evil empire for
an evil banana republic" --Viktor Pelevin, Generation P.
|