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

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



On Jul 31, Paul King said:

>I guess you can say that  Perl had fun with me. For clarity, this
>bug has already been solved, and I think it is a bug that is unique
>to Perl, and something that makes a clever novice-level puzzle.

>$upper = 2048;
>for  ($i = 1; $i <= $upper; $i ++) {
>   $date = &getadatestringfromsomewhere();
>   $my_date = &parseDate($date); # return a different date format
>}

My guess is your "bug" is centered around the lack of variable
scope.  Your parseDate() function probably uses a variable $i without
declaring it locally or putting it in a separate package.

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