use Time::Local;
print "Please enter a date (MM DD YYYY): ";
chomp($input = <STDIN>);
($mon, $day, $year) = split(/\s+/, $input);
$input_sec = timelocal(0,0,0,$day,$mon -1,$year);
$sixdays = 60 * 60 * 24 * 6;
$fourteen_hrs = 60 * 60 * 14;
$futureseconds = $input_sec + $sixdays + $fourteen_hrs;
print 'The date in six days, fourteen hours would be '.localtime($futureseconds)."\n";
$fortyfivedays = 60 * 60 * 24 * 45;
$pastSeconds = $input_sec - $fortyfivedays;
print 'The date 45 days in the past would be '.localtime($pastSeconds)." or $pastSeconds\n";
$now = time;
$diff = abs($now - $input_sec);
$diff_min = int($diff / 60);
print "The difference between the input date and now is $diff_min minutes.\n";
do {
print "Please enter a path to scan: ";
chomp($path = <STDIN>);
}until(-d $path);
opendir(PTH, $path) || die "cannot open path for read: $!";
while($item = readdir(PTH)) {
next if(($item eq '.') || ($item eq '..'));
$fullpath = $path .'/'.$item;
@finfo = stat($fullpath);
print "File: $fullpath\n";
print "\tFile Size: $finfo[7]\n";
print "\tCreation Date: ".localtime($finfo[10])."\n";
}
closedir(PTH);
print "Enter your birth date (MM DD YYYY): ";
chomp($bday = <STDIN>);
($mon, $day, $year) = split(/\s+/, $bday);
$bdSeconds = timelocal(0,0,0,$day,$mon - 1,$year);
$diffHRS = int(($now - $bdSeconds)/(60 * 60));
$diffDYS = int($diffHRS/24);
print "You are $diffHRS hours old or $diffDYS days.\n";
print "Or $diffDYS days and ".($diffHRS - ($diffDYS * 24))." Hours old.\n";
exit;