Skip Menu |

This queue is for tickets about the Bank-Holidays CPAN distribution.

Report information
The Basics
Id: 29853
Status: resolved
Priority: 0/
Queue: Bank-Holidays

People
Owner: Nobody in particular
Requestors: jbubado [...] telco214.com
Cc:
AdminCc:

Bug Information
Severity: (no value)
Broken in: (no value)
Fixed in: 0.66



Subject: Bank::Holidays
Date: Mon, 8 Oct 2007 18:32:29 -0400
To: <bug-Bank-Holidays [...] rt.cpan.org>
From: "Ian Rubado" <jbubado [...] telco214.com>
Hi there, The following code assumes a two digit day: --------------------- if ( $col =~ /(\d{4})/ ) { $colyears[$colcount] = $1; } elsif ( $col =~ /(\w+)\s(\d{2})(\d|)$/ ) { push @{$holidays->{$colyears[$colcount]}->{$months->{$1}}}, { day => $2, satflag => $3 }; } ---------------------- But the federal reserve page uses 1 digit for single digit days. SO, should be: } elsif ( $col =~ /(\w+)\s(\d{1})(\d|)$/ ) { Thanks.
Subject: RE: [rt.cpan.org #29853] AutoReply: Bank::Holidays
Date: Sun, 14 Oct 2007 22:20:19 -0400
To: <bug-Bank-Holidays [...] rt.cpan.org>
From: "Ian Rubado" <jbubado [...] telco214.com>
Hi there, I made a mistake when submitting my fix. Simply changing the {2} to {1} only made the problem worse. Also, given there is no good way to tell if the sat flag is set; I had to devise the following code based on the most recently updated K8 page located at http://www.federalreserve.gov/releases/k8/. I am sure there are more elegant ways to do this. ------------------------------------- Here is my foreach on cols. foreach my $col ( @$row ) { if ( $col ) { if ( $col =~ /(\d{4})/ ) { $colyears[$colcount] = $1; } elsif ( $col =~ /(\w+)\s(\d{1,3})$/ ) { my $day; my $satflag; if( $2 > 31 ){ $day = substr($2,0,2); $satflag = 1; } else{ $day = $2; $satflag = ''; } push @{$holidays->{$colyears[$colcount]}->{$months->{$1}}}, { day => $day, satflag => $satflag }; } } $colcount++; } Hope this helps someone else.
On Mon Oct 08 18:37:05 2007, jbubado@telco214.com wrote: Show quoted text
> Hi there, > > The following code assumes a two digit day: > --------------------- > if ( $col =~ /(\d{4})/ ) { > $colyears[$colcount] = $1; > } elsif ( $col =~ /(\w+)\s(\d{2})(\d|)$/ ) { > push @{$holidays->{$colyears[$colcount]}->{$months->{$1}}}, > { > day => $2, > satflag => $3 > }; > > } > ---------------------- > But the federal reserve page uses 1 digit for single digit days. > SO, should be: > > > } elsif ( $col =~ /(\w+)\s(\d{1})(\d|)$/ ) { > > > Thanks. > > > > > >