in reply to Where to put my variables...

I think dvergin has pretty well covered it -- declare the variables right when you're going to use them.

The exception for that would be when you have quite a large subroutine (one module that I wrote and still maintain is 2000 lines long, and mostly consists of a single routine 1750 lines long) -- in that case I put virtually all of my variable declarations at the top of the routine. That way there was less searching for variable declarations scattered around.

--t. alex

"Nyahhh (munch, munch) What's up, Doc?" --Bugs Bunny