in reply to if && condition not working

Use perltidy to neaten up your code. Maybe you will be less confused.

use strict and warnings. I get warning messages when I compile your code:

perl -wc -Mdiagnostics 830638.pl
You should eliminate the warnings before proceeding.

Also, consider using one of the many CPAN Date modules. Date::Calc has a "How do I compare two dates?" recipe.