Home  |  Linux  | Mysql  | PHP  | XML
From:CH Date:Wed Jun 18 04:11:05 2003
Subject:Re: [MacPerl-WebCGI] compound conditional statement driving me nuts
On onsdag, jun 18, 2003, at 02:18 Europe/Stockholm, Lee Collings wrote:

> if 	(($start_pub_year ge $yr && $end_pub_year le $yr) &&
> 	 ($start_pub_mon ge $mo && $end_pub_mon le $mo) &&
> 	 ($start_pub_day ge $day && $end_pub_day le $day))
> 	{
> Print "it is a valid date"
> 	}
> Print "it isn't a valid date"
>

1) Don't capitalize print

2) If start_pub is April 10 2003 this test will fail for example on 
July 1 2003 since
$start_pub_day ge $day
will be false. Just concatenating strings to "YYYYMMDD" will work for 
numeric comparisons.

Christian Huldt

Navigate in group perl.macperl.webcgi at sever nntp.perl.org
Previous Next




  
© No Copyright
You are free to use Anything
Site Maintained by PHP Developer
Powered By PHP Consultants