]>
Dogcows Code - chaz/p5-CGI-Ex/blob - samples/index.cgi
5 index.cgi - Show a listing of available utilties in the samples directories.
10 use base
qw(CGI::Ex::App);
13 __PACKAGE__-
>navigate;
17 <head><title>CGI::Ex Samples</title></head>
19 <h1>CGI::Ex Samples</h1>
20 Looking at directory: [% base %]<br>
21 All of the samples in this directory should be ready to run. To
22 enable this directory you should use something similar to the following in your apache conf file:
24 ScriptAlias /samples/ /home/pauls/perl/CGI-Ex/samples/
25 <Location /samples/>
26 SetHandler perl-script
27 PerlResponseHandler ModPerl::PerlRun
31 For mod_perl 1 you would use something similar to:
33 ScriptAlias /samples/ /home/pauls/perl/CGI-Ex/samples/
34 <Location /samples/>
35 SetHandler perl-script
36 PerlHandler Apache::PerlRun
41 <h2>Application examples</h2>
42 [% FOREACH file = app.keys.sort ~%]
43 <a href="[% script_dir ~ file %]">[% script_dir ~ file %]</a> - [% app.$file %]<br>
46 <h2>Benchmark stuff</h2>
47 [% FOREACH file = bench.keys.sort ~%]
48 [% file %] - [% bench.$file %]<br>
52 [% FOREACH file = therest.keys.sort ~%]
53 [% file %] - [% therest.$file %]<br>
63 my $base = $self->base_dir_abs;
68 File
::Find
::find
(sub {
70 return if $File::Find
::name
=~ / CVS | ~$ | ^\# /x;
71 $File::Find
::name
=~ /^\Q$base\E(.+)/ || return;
77 if ($str =~ /^=head1 NAME\s+(.+)\s+^=cut\s+/m) {
79 $desc =~ s/^\w+(?:\.\w+)?\s+-\s+//;
85 $hash->{'base'} = $base;
87 $hash->{'script_dir'} = $ENV{'SCRIPT_NAME'} || $0;
88 $hash->{'script_dir'} =~ s
|/[^/]+$||;
90 $hash->{'app'} = {map {$_ => $file{$_}} grep {/app/ && /\.cgi$/} keys %file};
92 $hash->{'bench'} = {map {$_ => $file{$_}} grep {/bench/ && /\.pl$/} keys %file};
94 $hash->{'therest'} = {map {$_ => $file{$_}} grep {! exists $hash->{'bench'}->{$_}
95 && ! exists $hash->{'app'}->{$_}} keys %file};
This page took 0.044888 seconds and 4 git commands to generate.