Common Warnings and Error messages in Perl
While the warnings and error messages Perl gives are quite precise, they are not always very beginner friendly. In these articles you'll find some of the most common warnings and error messages you'll encounter, explained in, hopefully a more beginner-friendly way.
Some of the articles even include directions showing how to fix the error.
- Global symbol requires explicit package name
- Global symbol requires explicit package name explained in Variable declaration in Perl
- Use of uninitialized value
- Bareword not allowed while "strict subs" in use
- Name "main::x" used only once: possible typo at ...
- Unknown warnings category
- Can't use string (...) as a HASH ref while "strict refs" in use at ...
- Explained in Symbolic references in Perl
- Can't locate ... in @INC
- Scalar found where operator expected
- "my" variable masks earlier declaration in same scope
- Can't call method ... on unblessed reference
- Argument ... isn't numeric in numeric ...
- Can't locate object method "..." via package "1" (perhaps you forgot to load "1"?)
- Odd number of elements in hash assignment
- Possible attempt to separate words with commas
- Undefined subroutine ... called
- Useless use of hash element in void context
- Useless use of private variable in void context
- readline() on closed filehandle
- Possible precedence issue with control flow operator
- Scalar value ... better written as ...
- Have exceeded the maximum number of attempts (1000) to open temp file/dir
- substr outside of string at ...
- Have exceeded the maximum number of attempts (1000) to open temp file/dir
- Deep recursion on subroutine
- Use of implicit split to @_ is deprecated ...
- Variable "..." will not stay shared ...
perldiag also has longer explanations for each one of the errors and warnings that you can skim, or you can access the specific explanation using diagnostics or splain.
Published on 2014-03-28