Skeeter87
03-02-2005, 05:39 PM
I want to categorise the year in the variable $yearr...but somehow it seems to go wrong :eek: Maybe someone can help me out here
#!/usr/bin/perl
use CGI;
$q=new CGI;
print "Content-Type: text/html\n\n";
$yearr="1975";
if ($yearr=>1900 && $yearr<1940) {$cat="1";}
if ($yearr=>1940 && $yearr<1980) {$cat="2";}
if ($yearr=>1980 && $yearr<2020) {$cat="3";}
print $cat;
#!/usr/bin/perl
use CGI;
$q=new CGI;
print "Content-Type: text/html\n\n";
$yearr="1975";
if ($yearr=>1900 && $yearr<1940) {$cat="1";}
if ($yearr=>1940 && $yearr<1980) {$cat="2";}
if ($yearr=>1980 && $yearr<2020) {$cat="3";}
print $cat;