Stories
Slash Boxes
Comments
NOTE: use Perl; is on undef hiatus. You can read content, but you can't post it. More info will be forthcoming forthcomingly.

All the Perl that's Practical to Extract and Report

use Perl Log In

Log In

[ Create a new account ]

Journal of markjugg (792)

Saturday July 23, 2005
02:06 PM

::Plugin::AutoRunmode, a welcome simplification of CGI::App

[ #25862 ]

CGI::Application::Plugin::AutoRunmode is a welcome simplification to the common CGI::Application workflow.

It allows you to get rid of setup() while maintaining clarity. An illustration:

before:

sub setup {
    my $self = shift;
    $self->start_mode('my_run_mode');
    $self->runmodes(qw/
        my_run_mode
        another_run_mode
    /);
}

sub my_run_mode {
        # do something here
}

sub another_run_mode  {
        # do something else
}

After:

use CGI::Application::Plugin::AutoRunmode;

sub my_run_mode : StartRunmode {
        # do something here
}

sub another_run_mode : Runmode {
        # do something else
}

The Fine Print: The following comments are owned by whoever posted them. We are not responsible for them in any way.
 Full
 Abbreviated
 Hidden
More | Login | Reply
Loading... please wait.