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

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



> 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.

Paul King


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