Chapter 10. Semantical Errors

“Pay attention even to trifles.”

—A Book of Five Rings, by Miyamoto Musashi

Semantical errors are a way of saying that when all else succeeds, you can still be wrong. The program compiles; it runs without any kind of run-time exception; it just doesn't do what you intended. This is why you need system testing (see Chapter 6).

(If you're relatively new to Perl, this chapter might raise the hairs on the back of your neck a little. Feel free to return to it after you've gotten more comfortable with the language.) Here's a tour of some examples of this obnoxious species of bug.

Get Perl Debugged now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.