in reply to Re: if && condition not working
in thread if && condition not working
sub validate_date { my $start_date = $_[0]; my $end_date = $_[1]; my $today_date = $_[2]; my @start_date_array = split(/\//, $start_date); my @end_date_array = split(/\//, $end_date); my @today_date_array = split(/\//, $today_date); my $error_msg = ""; if (!$start_date || !$end_date){ $error_msg = "Blank Field in Date field. Please Use Browser Ba +ck button and Enter Date Field"}; # if ( (@start_date_array[0] > @today_date_array[0]) && (@start_ +date_array[1] > @today_date_array[1]) && (@start_date_array[2] > @tod +ay_date_array[2])) { if (@start_date_array[0] > @today_date_array[0]) { $error_msg = "Start Date can not be a Future Date. Please Use +Browser Back button and Enter Start Date"}; if ( (@end_date_array[0] > @today_date_array[0]) && (@end_date +_array[1] > @today_date_array[1]) && (@end_date_array[2] > @today_dat +e_array[2])) { $error_msg = "End Date can not be a Future Date. Please Use Br +owser Back button and Enter End Date"}; return $error_msg; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: if && condition not working
by kennethk (Abbot) on Mar 24, 2010 at 19:19 UTC |