On Tue, Feb 24, 2009 at 04:58, S, Rajini (STSD) <rajin...@hp.com> wrote: > > My code in the program is : > > use strict; > use warnings; > > use Time::Local; > > my $days1 = epoch_days('30-Jan-09'); > my $days2 = epoch_days('16-Feb-09'); > > my $day = $days2 - $days1; > > print "Difference: @{[$days2 - $days1]} 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); > } > } > > > -Rajini > > > > > >>-----Original Message----- >>From: Rob Dixon [mailto:rob.di...@gmx.com] >>Sent: Tuesday, February 24, 2009 4:40 AM >>To: Perl Beginners >>Cc: S, Rajini (STSD) >>Subject: Re: Query in Perl Programming >> >>S, Rajini (STSD) wrote: >>> From: Owen [mailto:rc...@pcug.org.au] >>>> S, Rajini (STSD) wrote: >>>>> >>>>> When I included the below code in my script, I am getting below >>>>> errors. >>>>> >>>>> Use of uninitialized value in integer ge (>=) at >>>>> /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73. >>>>> Use of uninitialized value in integer lt (<) at >>>>> /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73. >>>>> Use of uninitialized value in integer ge (>=) at >>>>> /usr/local/lib/perl5/5.8.0/Time/Local.pm line 73. >>>>> Use of uninitialized value in integer gt (>) at >>>>> /usr/local/lib/perl5/5.8.0/Time/Local.pm line 77. >>>>> >>>>> Any idea, why I am getting above errors ? snip
I don't seem to get any errors when running this code. Are you still getting the warnings above? -- Chas. Owens wonkden.net The most important skill a programmer can have is the ability to read. -- To unsubscribe, e-mail: beginners-unsubscr...@perl.org For additional commands, e-mail: beginners-h...@perl.org http://learn.perl.org/