Right I've commented everything out and found that the problem seems to hinge on my IF statement. This is my code now:
use strict;
use diagnostics;
use CGI qw(:standard);
use CGI::Carp qw/fatalsToBrowser/;
use Win32::ODBC;
use lib '/perlcgi/settings';
require 'settings.pl'; # Included configuration file which contains g
+lobal variables
my %labels = (
MA => 'Mortgage Advisers',
CA => 'Customer Advisers',
BM => 'Branch Management',
HO => 'Head Office',
Acc => 'Accord',
MSa => 'MCC Sales',
MSe => 'MCC Service',
);
my $cgi = CGI->new;
my $dept = $cgi->param('department');
my $folderday = '19Apr';
my $SqlStatement ='SELECT * FROM Pipeline WHERE Publish<="$today" AND
+Expiry>="$today" AND CA="Must Read"';
my $today = '19 Apr 2006';
print $cgi->header('text/html');
if (defined $dept) {
if (exists $labels{$dept}) {
# FIXME
# untaint $dept and put it into database
print
$cgi->start_html,
$cgi->p("$dept was received."),
if ($dept ='CA'){
} # end of IF CA=
$cgi->end_html;
} else {
print
$cgi->start_html,
$cgi->p("$dept was received, but is not a valid department
+ name."),
$cgi->end_html;
};
} else {
print
$cgi->start_html,
$cgi->start_form(
-action => $cgi->script_name,
),
$cgi->popup_menu(
-name => 'department',
-values => [keys %labels],
-labels => \%labels,
),
$cgi->submit,
$cgi->end_form,
$cgi->end_html;
};
The error message says there are compilation errors and syntax errors at this bracket: } # end of IF CA=
but I think it doesn't like: if ($dept ='CA'){
What's wrong with that? |