I think this is the real point about Perl code readability: it gives you enough flexibility to do things however you like, and as a result many programmers are faced with a mirror that reflects their own bad practices back at them.
-orev, Hacker News
This is why Damian Conway's Perl Best Practices (2005) is one of my favorite books and perlcritic
, the code analyzer is one of my favorite tools. Although, the former could do with an update and the latter includes policies that contradict Conway. Point perlcritic
at your code, maybe add some other policies that agree with your house style, and gradually ratchet up the severity level from "gentle" to "brutal." All kinds of bad juju will come to light, from wastefully using grep
to having too many subroutine arguments to catching private variable use from other packages. perlcritic
offers a useful baseline of conduct and you can always customize its configuration to your own tastes.
Video for Better Perl: Subroutine Signatures and Type Validation
Video for my presentation to Houston Perl Mongers last month, based on this blog post. Slides are here. Sorry about all the "um"s and "ah"s.