How can the Start::output method get hold of the CGI::App methods?
Just pass your CGI::App object to Start when you instantiate it.
sub start { my ($self) = @_; my $start = Start->new( app => $self ); return $start->output; }
And stick it in your Start object.
package Start; use strict; use warnings; sub new { my $class = shift; my %args = @_; my $self = { app => $args{app}; }; bless $self, $class; }
And, optionally, add an accessor method if you don't want to peek at the hashref directly.
sub app { my $self = shift; return $self->{app}; }
And then access the object.
sub output { my ($self) = @_; my $query = $self->app->query; my $param = $self->app->param( 'my_param' ); # do stuff return $output; }
In reply to Re: CGI::Application - How to use a module for each runmode?
by friedo
in thread CGI::Application - How to use a module for each runmode?
by wfsp
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |