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

gives me:

syntax error at Supersite.pm line 684, near "$rms{"
syntax error at Supersite.pm line 685, near "}"

Where did I go wrong?
 
 
>>>Michael Peters <[EMAIL PROTECTED]> 03/11 4:12 pm >>> 
Geoffrey G. Hankerson wrote: 
>I hope this is an easy question that I am just missing. 
> 
>I want to call a different run from another run mode, but I don't know 
>the name of the subroutine to call, I just know the key from the 
>$self->run_modes hash (but not the value) 
> 
>So I know how to get the key: 
>my $runmode = $query->param('page'); 
> 
> 
>I know how to call another run mode if I know the name of the
subroutine 
>ahead of time 
> 
>return $self->my_other_sub(); 
> 
>but I don't know how to call another runmode if I only know the key
from 
>the run_mode hash 
 
the run_modes() method will return the hash of run_modes that you gave 
it in setup(). So something like this should work: 
 
my $runmode = $query->param('page'); 
my %rms = $self->run_modes(); 
return $self->$rms{$runmode}; 
 
HTH 
 
-- 
Michael Peters 
Developer 
Plus Three, LP 
 

---------------------------------------------------------------------
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