And that's why people always recommend to use strict; -- it complains about undeclared variables, so it forces you to think about where to put the declaration. And you only put the declaration outside the subroutine if that's your conscious choice.
| [reply] [d/l] [select] |
Really bad idea to use a subs like this with a globally defined array.
It's a really bad idea to use subs (or anything else) with a globally defined, non-constant anything unless, as moritz has written, it's your conscious decision to do so — and even then I'd think twice about it.
| [reply] |