Simplicity Made Easy
The second task of last week’s Perl Weekly Challenge
was to list the dates of the last Friday in every month of a given year. Many of the participants went to great lengths to create efficient and accurate solutions:
tracking the last day of each month, detecting leap years correctly,
working out formulas for the day of the month for a particular date,
managing the complex date arithmetic required. We don’t need to explicitly worry how long each month is, whether the year is a leap
year, or how to work out whether a given day is a Friday; the Date class takes
care of all that for us.
Source: blogs.perl.org