IMHO, variables should be declared where they are used, and in as small a scope as possible. I would recommend following your first example.
In reply to Re: Naming convention for variables, subroutines, modules, etc.. and variable declaration
by rhesa
in thread Naming convention for variables, subroutines, modules, etc.. and variable declaration
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |