in reply to loop labels and script dying

I'm guessing you're using mod_perl. The answer is, I think, because NUMBER isn't in scope when next is called. Try enabling warnings.

I would recommend returning from next_loop() either 1 or 0 and doing next_loop() && next NUMBER; in the main loop.

------
We are the carpenters and bricklayers of the Information Age.

The idea is a little like C++ templates, except not quite so brain-meltingly complicated. -- TheDamian, Exegesis 6

Please remember that I'm crufty and crochety. All opinions are purely mine and all code is untested, unless otherwise specified.