On Wed, 2002-02-06 at 05:35, Jesse Shy wrote:
>
> Is there a way to keep an object persistant across run modes
> psudo-code:
>
>
> sub setup {
>
> $o = Budget->GetNumbers($var);
>
> }
>
> sub Summary {
>
> $o->BuildSummary();
>
> }
>
> sub Details {
>
> $o->BuildDetails();
>
> }
I usually do this by building a helper method into the CGI::Application
subclass like so
sub setup {
my $self = shift;
$self->{_budget} = Budget->GetNumbers($var);
}
sub budget {
my $self = shift;
return $self->{_budget};
}
Then in any of your runmodes you can call
$self->budget->BuildSummary();
or
$self->budget->BuildDetails();
Since CGI::Application makes you use an OO structure, you might as well
take advantage of it.
Cees
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]