On Thu, 23 May 2002, Cory Trese wrote:

> (1) return $self->other_run_mode;
>
> I have not tried this, but would be interested to know if a way to pass
> parameters to the new run mode exists, directly in the function, a way to
> set CGI parameters.

This is the method I've used, and the one I advocate in my upcoming book,
which is being edited by Jesse "CGI::Application" Erlbaum ("Writing Perl
Modules for CPAN").  If you need to setup parameters for the run-mode then
you can modify the CGI object.  For example, an application that shows a
directory tree might have a default run-mode of show_root().  But really
you'd like to have just one method called show_dir() that can show any
directory.  So show_root() might look like:

  sub show_root {
      my $self  = shift;
      my $query = $self->query;
      $query->param(dir => '/');   # set dir param for show_dir()
      return $self->show_dir();    # goto show_dir() run-mode
  }

-sam


---------------------------------------------------------------------
Web Archive:  http://www.mail-archive.com/cgiapp@lists.vm.com/
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to