diff options
| -rwxr-xr-x | challenge-048/peter-scott/perl/ch-2.pl | 13 | ||||
| -rwxr-xr-x | challenge-048/peter-scott/perl/ch-2.pl~ | 13 |
2 files changed, 26 insertions, 0 deletions
diff --git a/challenge-048/peter-scott/perl/ch-2.pl b/challenge-048/peter-scott/perl/ch-2.pl new file mode 100755 index 0000000000..65f221ed2b --- /dev/null +++ b/challenge-048/peter-scott/perl/ch-2.pl @@ -0,0 +1,13 @@ +#!/usr/local/bin/perl +use 5.016; +use warnings; +use DateTime; + +my $dt=DateTime->new(year=>2000, month=>1, day=>1); +my $dt_end = DateTime->new(year=>2999,month=>12, day=> 31); +while ( DateTime->compare( $dt, $dt_end ) <= 0 ) +{ + local $_ = $dt->strftime("%m%d%Y"); + /(\d)(\d)(\d)(\d)\4\3\2\1/ and say; + $dt->add( days => 1 ); +} diff --git a/challenge-048/peter-scott/perl/ch-2.pl~ b/challenge-048/peter-scott/perl/ch-2.pl~ new file mode 100755 index 0000000000..3227b82625 --- /dev/null +++ b/challenge-048/peter-scott/perl/ch-2.pl~ @@ -0,0 +1,13 @@ +#!/usr/local/bin/perl +use 50.16;; +use warnings; +use DateTime; + +my $dt=DateTime->new(year=>2000, month=>1, day=>1); +my $dt_end = DateTime->new(year=>2999,month=>12, day=> 31); +while ( DateTime->compare( $dt, $dt_end ) <= 0 ) +{ + local $_ = $dt->strftime("%m%d%Y"); + /(\d)(\d)(\d)(\d)\4\3\2\1/ and say; + $dt->add(days => 1 ) +} |
