Subject: | Switch causes compilation error |
This program fails to compile with "Bad case statement (invalid case
value?) near ./search.cgi line 20 at
/usr/local/share/perl/5.10.0/Switch.pm line 201"
This is a stripped out code from a real program in which Switch gets
confused by the word 'case' in a print statement.
#!/usr/bin/perl -w
use diagnostics;
use strict;
use warnings;
use Switch;
my $language = 'English';
if($language eq "Italian") {
print <<'OUTPUT';
Italy
OUTPUT
} elsif($language eq 'Danish') {
print <<'OUTPUT';
Denmark
OUTPUT
} else {
print <<'OUTPUT';
case
OUTPUT
}