Bank-Holidays
view release on metacpan or search on metacpan
lib/Bank/Holidays.pm view on Meta::CPAN
mkdir( $home . "/.bankholidays" );
}
my $cache = $home . "/.bankholidays/frbholidays.html";
# Cache the content from the FRB since holdays are unlikely to
# change from day to day (or year to year)
my $content;
if ( -f $cache && ( time() - ( stat($cache) )[9] ) < 86400 ) {
open my $fh, "<", $cache or die $!;
$content = do { local $/ = <$fh> };
close $fh;
}
else {
my $url = 'http://www.federalreserve.gov/aboutthefed/k8.htm';
my $request = HTTP::Request->new( 'GET', $url );
my $response = $ua->request($request);
( run in 1.093 second using v1.01-cache-2.11-cpan-49f99fa48dc )