繁星淼淼
1234use Date::Calc qw/Delta_Days/; # $Dd = Delta_Days($year1,$month1,$day1 => $year2,$month2,$day2);$days = Delta_Days(2000,10,31,2016,10,31); # 5844如果日子 1 是比日期 2 来得晚 (如: $year1 为 2016, $year2 为 2000), 则会显示为负数
明月笑刀无情
1234567use Time::Local;print elapse(2016, 12,1);sub elapse { my ($y, $m, $d) = @_; my $f = timelocal(0, 0, 0, $d, $m - 1, $y); return int((time -$f)/86400);}