I want to calculate (using the default Perl installation only) the number of days between two dates. The format of both the dates are like so 04-MAY-09. (DD-MMM-YY)
I
Time::ParseDate will handle that format just fine:
use Time::ParseDate qw(parsedate); $d1="04-MAR-09"; $d2="06-MAR-09"; printf "%d days difference\n", (parsedate($d2) - parsedate($d1)) / (60 * 60 * 24);