#!/usr/bin/perl use Mojolicious::Lite; use Mojolicious::Plugin::CGI; my %cgi_scripts = ( '/clickable_image' => "clickable_image.cgi", '/cookie' => "cookie.cgi", '/crash' => "crash.cgi", '/file_upload' => "file_upload.cgi", '/wikipedia_ex' => "wikipedia_example.cgi", ); foreach my $route ( sort keys( %cgi_scripts ) ) { plugin CGI => [ $route => $cgi_scripts{$route} ]; } any '/' => sub { my ( $c ) = @_; $c->stash( { cgi_scripts => { %cgi_scripts } } ); $c->render( 'index' ); }; app->start; __DATA__ @@ index.html.ep <!doctype html><html> <head><title>CGI Examples</title></head> <body> <h3>CGI Examples</h3> % for my $route ( sort keys( %{ $cgi_scripts } ) ) { <a href="<%= $route %>"><%= $cgi_scripts->{$route} %></a><br /> % } </body> </html>
Name | Type | Size | Permission | Actions |
---|---|---|---|---|
clickable_image.cgi | File | 1.4 KB | 0755 |
|
cookie.cgi | File | 2.74 KB | 0755 |
|
crash.cgi | File | 154 B | 0755 |
|
file_upload.cgi | File | 2.38 KB | 0755 |
|
mojo_proxy.pl | File | 801 B | 0644 |
|
wikipedia_example.cgi | File | 918 B | 0755 |
|
wilogo.gif | File | 458 B | 0644 |
|