While we're sharing our examples, I have a boatload of one-off type example Perl scripts in my scripts repo here :)
I think it's a good idea to share our one-off-type stuff!
| [reply] |
| [reply] [d/l] |
Cool idea. I wouldn't recommend that implementation as an example of good Perl style, though:
my $date_1 = new DateTime (year => 2014, month => 7, day => 5);
my $date_2 = new DateTime (year => 2014, month => 7, day =>15);
# Calculate Δ
# delta_tays() returns a DateTime::Duration object
printf "date_2 (%s) is %d days away from date_1 (%s)\n", $date_2 -> dmy, $date_1->delta_days($date_2)->delta_days, $date_1 -> dmy;
my $today = today DateTime;
printf "Tdoay is %s\n", $today->dmy;
( sic: https://github.com/ReneNyffenegger/PerlModules/blob/master/DateTime/script.pl )
The way forward always starts with a minimal test.
| [reply] |