in reply to Re: Re: Re: Re: Best method for dynamic page generation?
in thread Best method for dynamic page generation?

i just started using CGI::Application this week, so my opinion may not be totally informed.

it's sort-of a subclass of CGI. it provides you a way to *organize* your run-modes ( actions ) in your application with a defined set of parameters and matching subroutines. something like:

"foo_action" => \&foo(), "bar_action" => \&bar()
and later in your module:
sub foo { my $self = shift; # do stuff }
it's something i used to do by hand. CGI::Application organizes it a bit more, and makes it a touch easier to come back to and debug, esp. if you're not the original coder.

Replies are listed 'Best First'.
Re: Re: Re: Re: Re: Re: Best method for dynamic page generation?
by stonecolddevin (Parson) on Jan 04, 2004 at 06:03 UTC

    Oh, BRILLIANCE.

    Does it allow you to take query parameters to match your subroutines?

    "and I wonder, when I sing along with you if everything could ever feel this real forever? if anything could ever be this good again? the only thing I'll ever ask of you, you've gotta promise not to stop when I say 'when'", she sang
      here's part of a setup method ( i'm working on the project right now ) :
      sub setup { my $self = shift; $self->{TEMPLATEDIR} = "/home/templates"; $self->start_mode('edit_setup'); $self->mode_param('rm'); $self->run_modes( 'setup' => \&setup_list, 'edit_setup' => \&setup_edit, 'view_listing' => \&view_listing, }
      the start_mode determines what the first value of your run_mode will be.

      subs are then executed by URLs like:  index.cgi?rm=view_listing

      now go read the  perldoc on it. ;-)


        That's absolutely awesome, I've always wanted something that would do that for me. I'll go read up on it asap.
        dhoss
        "and I wonder, when I sing along with you if everything could ever feel this real forever? if anything could ever be this good again? the only thing I'll ever ask of you, you've gotta promise not to stop when I say 'when'", she sang