Mostly I declare them at the top, which habit I developed from C. If I'm only going to be using them in a relatively small place, then I'll declare them close to the code where I use them. For loops I declare them right at the loop unless it's a really short bit of code.
I don't have enough Perl experience yet to know yet whether my habits really work for Perl.
In reply to Re: A question of style - declaring lexicals
by baruch
in thread A question of style - declaring lexicals
by saskaqueer
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |