Older modules aren't so bad:
#!/usr/bin/env perl use strict; use warnings; use Date::Calc qw( Day_of_Week Today Day_of_Week_to_Text); use Try::Tiny; use feature qw(say); my %lookup = ( 'Friday' => \&acme ); my $day = Day_of_Week_to_Text( Day_of_Week(Today) ); say $day; $lookup{$day}->(); sub acme { try { ...; } catch { print $_; }; } __END__
Untested. Please see Date::Calc for more.
Update: Pretty print ;-)
"...I am too lazy..."
Lazy bum!
Best regards, Karl
«The Crux of the Biscuit is the Apostrophe»
perl -MCrypt::CBC -E 'say Crypt::CBC->new(-key=>'kgb',-cipher=>"Blowfish")->decrypt_hex($ENV{KARL});'Help
In reply to Re: date arithmetic
by karlgoethebier
in thread date arithmetic
by morgon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |