in reply to Calculating next business day (weekends/holidays taken into account)
Not actually addressing your problem but you could save a heap of typing when you initialise your holiday hashes. This
my %ny_holidays = (); ... $ny_holidays{'20090101'} = 'New Years Day'; $ny_holidays{'20090115'} = 'MLK'; $ny_holidays{'20090219'} = 'Presidents day'; $ny_holidays{'20090406'} = 'Good Friday'; $ny_holidays{'20090528'} = 'Memorial Day'; $ny_holidays{'20090704'} = 'Independence Day'; $ny_holidays{'20090903'} = 'Labor day'; $ny_holidays{'20091122'} = 'Thanksgiving'; $ny_holidays{'20091225'} = 'Christmas Day';
could be written like this
my %ny_holidays = ( '20090101' => 'New Years Day', '20090115' => 'MLK', '20090219' => 'Presidents day', '20090406' => 'Good Friday', '20090528' => 'Memorial Day', '20090704' => 'Independence Day', '20090903' => 'Labor day', '20091122' => 'Thanksgiving', '20091225' => 'Christmas Day', );
I hope this is of interest.
Cheers,
JohnGG
|
|---|