>
> Hi Owen,
>
> My code is as follows :
>
> use strict;
> use warnings;
> use Time::Local;
>
> $days1 = epoch_days('30-Jan-09');
> $days2 = epoch_days('16-Feb-09');
>
> $day = $days1 - $days2;
>
> print "Difference: @{[$days1 - $days2]} days\n";
>
> BEGIN {
>
>   my %month_num = do {
>     my $n = 0;
>     map(($_, $n++), qw/jan feb mar apr may jun jul aug sep oct nov
> dec/);
>   };
>
>   sub epoch_days {
>
>     my @dmy = split /-/, shift;
>     $dmy[1] = $month_num{lc $dmy[1]} || 0;
>   return timelocal(0, 0, 0, @dmy) / (24 * 60 * 60);
>   }
> }



I bet that is not your code!

Try # perl -c scriptname

and that will be the first fix


Owen


-- 
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/


Reply via email to