http://qs321.pair.com?node_id=11112183

My task here is to make a list of all of the "first day of the month" days between a start date and an end date. I'm interested to hear thoughts about my solution:
use strict; use warnings; use Time::Piece; use feature 'say'; my $date = Time::Piece->strptime( localtime->year() - 4 . " 01 01", "%Y %m %d" ); my $endDate = localtime(); while ( $date <= $endDate ) { say $date; # Get the next first of the month by going to the end of the # month and add one day my $year = $date->year; my $mon = $date->mon; my $day = $date->month_last_day; $date = Time::Piece->strptime( "$year $mon $day", "%Y %m %d" ) +; $date += Time::Seconds::ONE_DAY; }