Perl Best Practices Pdf May 2026
He found it buried in a forgotten ~/legacy/ebooks/ directory, the PDF metadata timestamped from an era when dial-up was still a noun. He opened it.
Chapter 1: Always use use strict; and use warnings; .
Over the next three nights, Erwin didn’t rewrite the code. He performed surgery with the PDF as his scalpel. He wrapped bare blocks in do { } . He replaced if(!$var) with unless($var) . He added perlcritic to the CI pipeline and watched its severity ratings drop from “brutal” to “stern.” perl best practices pdf
The junior dev, remorseful, asked how to help. Erwin slid her a USB stick. “Read Chapters 1 through 7. Then rename every $temp variable to something that means something.”
After twelve hours of triage, Erwin’s boss slid a printed email across the desk. “The auditors want a ‘Readability and Maintainability Compliance Plan.’ By Friday.” He found it buried in a forgotten ~/legacy/ebooks/
He felt a pang of shame. The core script had neither.
Chapter 18: Use named regex captures, not $1 , $2 , $3 . Over the next three nights, Erwin didn’t rewrite the code
Chapter 4: Don’t use $a and $b outside of sort() .