[Chicago-talk] Calculating Holidays

Richard Reina richard at rushlogistics.com
Thu Jul 12 10:34:05 PDT 2012


Hi Mike,

Thank you very much for the suggestion.  With some difficulty I was able to get the module installed. However, I am unclear on how it works.  The example given in the docs:
        
use DateTime::Event::Holiday::US;

my $thanksgiving = DateTime::Event::Holiday::US::holiday( 'Thanksgiving' );


gives me a hash reference which when I try to dereference with:

my %hash =  %$thanksgiving;

 foreach my $k (keys %hash) {
        print "$k: $hash{$k}\n";
    }


 gives me:

as_ical: ARRAY(0x1e63190)
set: Too complex

I was hoping it might give me the date for Thanksgiving. 

If any one can give me an idea as to what I am doing wrong in trying to use this module I would really appreciate it.

Thanks,

Richard



>  
>  Mike Fragassi <mikefrag at gmail.com> wrote:  

> Try DateTime::Event::Holiday::US.

 > On Jul 3, 2012 3:46 PM, <richard at rushlogistics.com> wrote:
>   
>  I am lost trying to write a simple script that tells
> me how many days until the next approaching holiday.
> has anyone ever done anything similar or know of anything
> helpful. I've looked at Date::Manip but that still
> leaves me with the cumbersome task of finding out
> which holiday is the next one from a given date.
>  
>  Any help would be appreciated as not solving it will
> keep me preoccupied all through the holiday.
>  
>  Thanks
>  
>  Richard
>  _______________________________________________
>  Chicago-talk mailing list
>  Chicago-talk at pm.org
>  http://mail.pm.org/mailman/listinfo/chicago-talk 
  
  
-- 
Richard Reina
Rush Logistics, Inc.
Watch our 3 minute movie: 
http://www.rushlogistics.com/movie



More information about the Chicago-talk mailing list