/usr/share/doc/libcgi-application-plugin-actiondispatch-perl/examples/TestApp.pm is in libcgi-application-plugin-actiondispatch-perl 0.99-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 | package TestApp;
use base 'CGI::Application';
use lib '../lib';
use CGI::Application::Plugin::ActionDispatch;
sub product : Regex('^/products/books/war_and_peace/(\d+)/') {
my $self = shift;
my $page_num = $self->action_args();
return "Runmode: product\nCategory: books\nProduct: war_and_peace\nArgs: $page_num\n";
}
sub home : Default {
return "Runmode: home\n";
}
sub test : Runmode {
my @args = $self->action_args();
return "Runmode: test\n";
}
sub fail : Path('fail') {
die "Call error mode";
}
sub error_page : ErrorRunmode {
return "Runmode: error_page\n";
}
1;
|