in reply to Scalars within Subroutines (scope)

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:)