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

Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

Hi Monks!

I need to get all last fridays of every month using Time::Piece, I am stuck here:
#!/usr/bin/perl use strict; use warnings; use Time::Piece; my $t = Time::Piece->new(); my $day_of_month = $t->day_of_month; print "\nTodays Number: $day_of_month\n\n"; my $year = $ARGV[ 0 ] || 2014; foreach my $month ( 1..12 ) { my $tdates = $t->strptime("$year/$month/$day_of_month", "%Y/%m/%d") +; my $day_of_week = $tdates->day_of_week; my $wday_name = $tdates->wdayname; print "Month: $month | Week Day Name:$wday_name | Week Day Number:$ +day_of_week\n"; #Need to get the last Friday of every month here: }

Any suggestions? Thanks for looking!