in reply to Re: How to Check Hashes for Missing Items when Keys can be Values and vice versa
in thread How to Check Hashes for Missing Items when Keys can be Values and vice versa

I agree that you habit of pre-declaring variables largely defeats the advantage of using strict (although it is still useful in detecting misspelled variables). Your suggestion of defining them at "first instance" is not much better. If fact, it can introduce errors (which strict can detect). A better strategy is to declare all variables in the "smallest possible scope". This does require some effort in writing new code and it does little to help your reader find the declarations. The advantage to you is that it greatly reduces the possibility of misusing a variable. The advantage to your reader is that, when he comes to the end of the scope, he knows for certain that he has seen all the references to the variable.
Bill
  • Comment on Re^2: How to Check Hashes for Missing Items when Keys can be Values and vice versa