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.
In reply to Switch (module) and Apache::Registry problem. by jdtoronto
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |