[Bio] / FigWebServices / ShowPod.cgi Repository:
ViewVC logotype

Annotation of /FigWebServices/ShowPod.cgi

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.4 - (view) (download)

1 : parrello 1.1 #!/usr/bin/perl -w
2 :    
3 :     use strict;
4 :     use CGI;
5 :     use Tracer;
6 : parrello 1.3 use DocUtils;
7 : parrello 1.1
8 :     =head1 Documentation Display
9 :    
10 :     This script displays a basic HTML POD document for any usable PERL module.
11 :    
12 :     The single CGI parameter is C<module>, which can be anything that's legal
13 :     in a C<use> statement.
14 :    
15 :     =cut
16 :    
17 :     # Get the CGI query object.
18 :     my $cgi = CGI->new();
19 : parrello 1.4 # Get the module name.
20 :     my $modName = $cgi->param('module') || "";
21 : parrello 1.1 # Start the output page.
22 :     print CGI::header();
23 : parrello 1.4 print CGI::start_html(-title => "$modName Documentation Page",
24 : parrello 1.1 -style => { src => "$FIG_Config::cgi_url/Html/css/ERDB.css" });
25 :     # Protect from errors.
26 :     eval {
27 : parrello 1.3 # We'll format the HTML text in here.
28 :     my $html;
29 : parrello 1.1 # Do we have a module?
30 :     if (! $modName) {
31 : parrello 1.3 $html = CGI::blockquote({ class => 'error' }, "No module specified.");
32 : parrello 1.1 } else {
33 : parrello 1.3 $html = DocUtils::ShowPod($modName, $cgi->url(-relative => 1) . "?module=");
34 : parrello 1.1 }
35 : parrello 1.3 print $html;
36 : parrello 1.1 };
37 :     # Process any error.
38 :     if ($@) {
39 :     print CGI::blockquote({ class => 'error' }, $@);
40 :     }
41 :     # Close off the page.
42 :     print CGI::end_html();
43 :    
44 :     1;

MCS Webmaster
ViewVC Help
Powered by ViewVC 1.0.3