in reply to Trouble with Dates
#!/usr/bin/perl use strict; use warnings; use 5.014; use Date::Calc qw( Delta_Days Days_in_Month ); while (<DATA>) { my ($y1, $m1, $d1, $y2, $m2, $d2) = split /\D+/; $y2 ||= $y1; $m2 ||= $m1; $d2 ||= Days_in_Month($y2, $m2); # last day in current month say Delta_Days($y1, $m1, $d1, $y2, $m2, $d2); }
|
|---|