jdtoronto has asked for the wisdom of the Perl Monks concerning the following question:
In my never ending search for more elegant looking and self-documenting code I decided to try out the Switch module. In the following fragment of code:
produces the following in the Apache error log:#!/usr/local/bin/perl # AppSys: Manage Profile use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use Switch; my $cgi = CGI->new; my $control = 'Search'; switch ( $control ) { case ("Search") { print $cgi->header; print $cgi->start_html; print $cgi->p("Search"); print $cgi->end_html; } }
When run as an Apache::Registry script.[error] syntax error at /home/appsys/www/modperl/ap03.pl line 12, near + ") {" syntax error at /home/appsys/www/modperl/ap03.pl line 14, near "} }"
When run under mod_cgi (i.e. run from the cgi-bin directory on the same server, it works perfectly and prints 'Search' on the browser.
I will ask this on the mod_perl list also, but I have had some good assistance here for mod_perl type questions, so maybe someone can help.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Switch (module) and Apache::Registry problem.
by diotalevi (Canon) on Oct 30, 2003 at 16:27 UTC | |
|
Re: Switch (module) and Apache::Registry problem.
by nevyn (Monk) on Oct 30, 2003 at 17:36 UTC | |
|
Re: Switch (module) and Apache::Registry problem.
by hardburn (Abbot) on Oct 30, 2003 at 16:30 UTC | |
by jdtoronto (Prior) on Oct 30, 2003 at 16:41 UTC | |
by hardburn (Abbot) on Oct 30, 2003 at 17:32 UTC |