On Mon, 14 Mar 2005 10:27:34 -0600, Geoffrey G. Hankerson
<[EMAIL PROTECTED]> wrote:
> 2. Micael Peters suggests:
> my $runmode = $query->param('page');
> my %rms = $self->run_modes();
> return $self->$rms{$runmode};
> 
> This returns this error:
> syntax error at Supersite.pm line 694, near "$rms{"
> syntax error at Supersite.pm line 696, near "}"

Try it this way instead:

my $runmode = $query->param('page');
my %rms = $self->run_modes();
my $rmeth = $rms{$runmode};
return $self->$rmeth();

Make sure that you are not using an 'AUTOLOAD' runmode, cause you will
have to manually handle that as well.  The easiest way to figure out
how to do this is to just look at the source for CGI::Application!  It
already figures out what the runmode is and calls it correctly, so the
code is already right there in front of you.  You just need to find
it.  Look midway through the 'run' method in CGI::Application for the
exact way that CGI::Application calls a runmode.

Cheers,

Cees

---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/[email protected]/
              http://marc.theaimsgroup.com/?l=cgiapp&r=1&w=2
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to