http://www.perlmonks.org?node_id=1091745


in reply to Gettting the last Friday of every month using Time::Piece

> Any suggestions? 

Take $n=$lastday->day_of_week of the last day of the month (according to Time::Piece 0=Sunday)

Then subtract $diff days from $lastday to get day_of_week 5 = Friday.

Ie. $diff = ($n-5) % 7

Cheers Rolf

(addicted to the Perl Programming Language)