in reply to Infinite loop yet no loop
SOMECLASS->_addbuf($buffer) if $buffer && @$buffer;
Two, it's time to go back to basics: Debug by observation. Rather than infer that the program is spinning uselessly, you should either (1) run a debugger and WATCH the program do the unexpected, or (2) add print statements or other tracery so you can know exactly what's getting called, with what arguments, in what order, and when.
sub _addbuf { print STDERR "_addbuf(", Dumper(\@_), ")\n"; ... if (...) { print STDERR "making a new item...\n"; } }
Three, it's time to go back to basics. I don't know if you're just skipping parts of your example, but why are you creating a $new instance but never using it or attaching it anywhere?
(Don't take my tone as being angry or anything; it's easy to stare at code and forget to think about the basics of what you're trying to accomplish. We all do it. Well, everyone except for tye.)
--
[ e d @ h a l l e y . c c ]
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: Infinite loop yet no loop
by ido50 (Scribe) on Mar 21, 2004 at 15:44 UTC |