----- Original Message ----- From: "Chris Charley" <[EMAIL PROTECTED]> Newsgroups: perl.beginners To: <[EMAIL PROTECTED]> Sent: Wednesday, April 21, 2004 6:48 PM Subject: Re: Date calculation
> > ----- Original Message ----- > From: "Jan Eden" <[EMAIL PROTECTED]> > Newsgroups: perl.beginners > To: "Perl Lists" <[EMAIL PROTECTED]> > Sent: Wednesday, April 21, 2004 1:29 PM > Subject: Date calculation > > > Hi, > > I need to find the number of days between two dates. The Perl Cookbook > provides this solution: > Hello Jan > Maybe something like this would do what you want :-) > for ( my $i = 0; $i <= $j; $i++ ){ This for loop should be: for ( my $i = 0; $i < $j; $i++ ) so that $i never equals $j (checkout day). > my @date = Add_Delta_Days(@chk_in,$i); > printf("%4d-%02d-%02d\t", @date); > my $day = Date_to_Days(@date); > print $day >= $beg && $day <= $end ? "\$80.00\n" : "\$55.00\n"; > } -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>