Hi,
could someone please help me with this little problem?
I am trying to include an if statement part way through printing.
When the program reaches the line if ($Lang = fr ) { print "
that line gets ignored and the cgi keeps going to the end.
thanks
Brian
#! c:\perl\bin\perl.exe -T
use warnings;
#use strict;
use CGI qw/:all/;
use CGI::Carp qw/fatalsToBrowser/;
use HTMLTMPL;
my $t = HTMLTMPL->new();
my $q = new CGI;
my $val1 = $q->param('language');
my $val2 = $q->param('year');
#my $submit = $q->param('Submit');
chomp($Lang = $val1);
chomp($Year_in = $val2);
if ($Lang <= 0 ) {$Lang = en;}
{
##### bunch of calcs that work perfectly #####
}
$t->output( CGI::header );
{
print "
<!DOCTYPE html PUBLIC \"-\/\/W3C\/\/DTD XHTML 1.0 Transitional\/\/EN\"
\"http:\/\/www.w3.org\/TR\/xhtml1\/DTD\/xhtml1-transitional.dtd\">
<html xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">
<head>
<title>$Year_in<\/title>
<style type=\"text\/css\">
<!--
#Layer1 {
position:absolute;
left:39px;
top:36px;
width:132px;
height:167px;
z-index:1;
}
.style1 {color: #000000}
##### snipped a few lines #####
-->
<\/style>
<\/head>
<body>
<table width=\"10%\" height=\"287\" border=\"0\" align=\"left\"
cellpadding=\"0\" cellspacing=\"0\">
<tr>
##### snipped a load of lines #####
<\/tr>"
};
############# next line is my problem line #################
if ($Lang = fr ) { print "
##### snipped loads of lines #####
<tr>
<td width=\"27\" height=\"27\"><div align=\"center\"
class=\"style4\">1<\/div><\/td>
##### snipped loads of lines #####
<\/table>
<\/body>
<\/html>"
##### nothing follows <\/html> #####
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/