Wise Monks,
I have a simple if && condition which is not working for me. I am perplexed. Please help. The code is below:
Regards, Rakhee
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])) {
$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;
}