Beefy Boxes and Bandwidth Generously Provided by pair Networks
good chemistry is complicated,
and a little bit messy -LW
 
PerlMonks  

Re: RFC: List of first day of each month

by choroba (Cardinal)
on Jan 31, 2020 at 15:28 UTC ( [id://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
Domain Nodelet?
Node Status?
node history
Node Type: note [id://11112184]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others goofing around in the Monastery: (2)
As of 2024-04-25 21:24 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found