Keep It Simple, Stupid | |
PerlMonks |
Re: Scalars within Subroutines (scope)by simeon2000 (Monk) |
on Jul 19, 2002 at 15:41 UTC ( [id://183277]=note: print w/replies, xml ) | Need Help?? |
Personally, I wouldn't use $a and $b because they are the default variables to compare in sort blocks. But as far as using the same names for variables in function1 and function2, as long as you properly scope them, there is no problem whatsoever. Technically, if your chief concern is clobbering your variables defined earlier, as long as you use warnings (as we all do, right?) with "my" scoping, perl will give you a heads up if you DO attempt to shoot yourself in the foot in this manner:)
In Section
Seekers of Perl Wisdom
|
|