Unlike many programming fads that fade within a few years, Perl Best Practices is timeless. The Perl 5 core has evolved, but the fundamental principles of code layout, naming conventions, control structures, and error handling have not changed dramatically.
These pragmas catch common errors like misspelled variable names or uninitialized values before they become bugs. 3. Naming Conventions and Variables perl best practices pdf
Here is where Conway turns TMTOWTDI on its head. He argues that just because you can write do_something() if $condition , you probably shouldn't, except for very short postfix conditions. The PDF mandates that complex expressions use block form to avoid dangling else bugs. Furthermore, he bans the use of unless with else clauses (because it becomes a double negative), and he bans for loops that modify the iterator variable. Unlike many programming fads that fade within a
Searching for a is particularly common among three groups of people: The PDF mandates that complex expressions use block
After these changes, the script is no longer "Perl golf." It is engineering.
perlcritic --verbose 11 my_script.pl