[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] A major screw-up: infinite loop



On Jul 31, abigail@foad.org said:

>On Mon, Jul 31, 2000 at 11:42:14AM -0400, Paul King wrote:
>> > Oh, parseDate set $i to 12, and it was incremented to 13 by the for loop.
>> > 12 does make more sense in a function called parseDate.  :)
>> >
>> > Ronald
>> 
>> I was pretty picky about this question, because on the face of it the problem
>> looks very simple. A global variable $i was "clobbered", as some have said,
>> by dateParse. But I wanted you to go a little beyond that. Why 13? Why not
>> some other number? And it looksas if Ronald has come the closest. It has to
>> do with ParseDate, which has an associative array of months, of which
>> there are 12. The $i that is in that function loops through the months. When
>> it exits, the calling routine always increments 12 to 13.
>
>
>Several things:

Those points are all nice and valid, Abigail, but the OP said he was using
his OWN library of date manipulation functions.

-- 
Jeff "japhy" Pinyan     japhy@pobox.com     http://www.pobox.com/~japhy/
PerlMonth - An Online Perl Magazine            http://www.perlmonth.com/
The Perl Archive - Articles, Forums, etc.    http://www.perlarchive.com/
CPAN - #1 Perl Resource  (my id:  PINYAN)        http://search.cpan.org/


==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe