The question on Hidden features of Perl yielded at least one response that could be regarded as either a feature or a mis-feature. It seemed logical to follow up with this question: what are common non-obvious mistakes in Perl? Things that seem like they ought to work, but don't.
I won't give guidelines as to how to structure answers, or what's "too easy" to be considered a gotcha, since that's what the voting is for.
Table of Answers
Syntax
- General
- Filehandles
Semantics/Language Features
- General
- Context
- Variables
Debugging
Best Practices
- Forgetting to
use strict
anduse warnings
(oruse diagnostics
) - Misspelling variable names (i.e.,
use strict
, again)
Meta-Answers
See Also: ASP.NET - Common gotchas