in reply to Re^3: Layers of Software
in thread Layers of Software

wouldn't the other moral of the story be: Always use strict?

I'd say moral of the story is, "use lexical variables." You don't have to use strict to do that, it just helps force your hand. Also, the word "always" is kind of dangerous, unless of course you meant the variety of "always" that is commonly -- but not always -- in effect. :-)

Replies are listed 'Best First'.
Re^5: Layers of Software
by tirwhan (Abbot) on Oct 19, 2005 at 18:29 UTC

    That is indeed the variant of always I meant :-)

    But personally I use non-lexical variables far more often than I do not use strict. @ARGV and $_ for example, or local $/ appear quite regularly in my code. The only times I regularly don't use strict is on one-liners or quick throwaway scripts. In which case I don't bother to lexicalize my variables either. Hmm, seeing that written down, maybe I should bother... And then there's legacy code of course, but I'd consider that code which hasn't been sufficiently refactored. So I would still say, always use strict unless you know better (in which case you don't need advice from the likes of me ;-).This node notwithstanding.