develooper Front page | perl.macperl.webcgi | Postings from June 2003

Re: [MacPerl-WebCGI] compound conditional statement driving me nuts

Thread Previous
From:
CH
Date:
June 18, 2003 03:11
Subject:
Re: [MacPerl-WebCGI] compound conditional statement driving me nuts
Message ID:
2C3845AD-A175-11D7-AE5B-0050E4164D2F@solvare.se

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


Thread Previous


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About