I am not allowed to use any new modules as this script has to be run on multiple computers.
That's just silly. If your admins don't allow new modules to be installed, use the
Perl Archive Toolkit to bundle up requisite modules into archives to be distributed with your script.
Use Date::Calc like this:
use Date::Calc qw/Delta_Days/;
use strict;
my @date1 = (2007, 12, 24); # or split '-', '2006-12-24';
my @date2 = (2009, 4, 16); # or split '-', '2009-4-16';
my $days = Delta_Days(@date1, @date2);
print "There are $days days between ".
sprintf('%04d-%02d-%02d',@date1)." and ".
sprintf('%04d-%02d-%02d',@date1).".\n";
-David