I'm not sure of I understand you correctly. AFAIK, http://perldoc.perl.org is not capable of checking Perl core for errors. But you can do it on your machine:
- Run perl -c yourfile.pl. Perl will compile your program and check for mistakes which can be found without running most of it.
- If if gave you an error message which you can't understand, try use diagnostics; (or add -Mdiagnostics command line switch) or ask splain program for help.
- If you still don't understand why Perl doesn't like some particular line (e.g. it happens on a completely valid line, empty line, or end-of-file), or the program works incorrectly without throwing errors, maybe your understanding of the program differs from Perl's at some earlier point. Run perl -MO=Deparse,-p yourfile.pl (which has the effect of temporaly adding use O 'Deparse', '-p'; to the file) and check if Perl understands you correctly. Additional '-p' option enables additional parentheses which cause incorrect program behaviour often.
- Indenting your programs now helps to understand them later. Your computer can indent a Perl program for you using perltidy.
- Everything works, but you are not sure whether you did something right? perlcritic will thoroughly search your code for common mistakes and suggest best practices.
See also:
basic debugging checklist.