#!C:/perl/bin/perl.exe # scriptname: index.pl BEGIN { my $development = 0; if ($development) { use CGI::Carp qw(fatalsToBrowser); } else { use CGI::Carp qw(fatalsToBrowser set_message carpout); open(LOG, ">>datadir/trap_error") or die("Unable to open mycgi_log: $!\n"); carpout(LOG); sub handle_errors { print "
An error occurred while processing your request. This error has been noted and appropriate action will be taken to rectify it.
~; } set_message(\&handle_errors); } } use Mymodule1; use Mymodule2; my $query = get_param('node') || 'start'; # Rest of code in the main script...