Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: RFC: List of first day of each month

by choroba (Archbishop)
on Jan 31, 2020 at 15:28 UTC ( #11112184=note: print w/replies, xml ) Need Help??


in reply to RFC: List of first day of each month

Looks good. I'd probably do it the same way. Alternatively, you can implement part of the logic yourself:
while ($date <= $endDate) { say $date; $date = 'Time::Piece'->strptime( join(' ', $date->year + ($date->mon == 12), $date->mon % 12 + 1 +, 1), '%Y %m %d'); }
Update: You can shorten your original solution. There's no need to parse the date again, just add the days.
while ($date <= $endDate) { say $date; $date += Time::Seconds::ONE_DAY * $date->month_last_day; }

map{substr$_->[0],$_->[1]||0,1}[\*||{},3],[[]],[ref qr-1,-,-1],[{}],[sub{}^*ARGV,3]

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://11112184]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others cooling their heels in the Monastery: (7)
As of 2020-05-29 06:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    If programming languages were movie genres, Perl would be:















    Results (166 votes). Check out past polls.

    Notices?