http://qs1969.pair.com?node_id=666044

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

Hi Monks!

How can I get yesterday's date from today's date, but making sure I don't get weekends for yesterday's date.
I can get yesterday's date using this:
#!/usr/bin/perl use strict; use CGI qw/:standard/; use CGI::Carp qw(fatalsToBrowser); use Date::Calc qw(Add_Delta_Days Day_of_Week); use Date::Calc qw(Today Add_Delta_Days); print header(); my @date = Add_Delta_Days( Today(), -1 ); print "@date\n";

But if I run it I am getting "2008-2-3" and it's a weekend date, any help?

Thanks!!!