Chapter 21. Common Practices
Almost any Perl programmer will be glad to give you reams of advice on how to program. We’re no different (in case you hadn’t noticed). In this chapter, rather than trying to tell you about specific features of Perl, we’ll go at it from the other direction and use a more scattergun approach to describe idiomatic Perl. Our hope is that, by putting together various bits of things that seemingly aren’t related, you can soak up some of the feeling of what it’s like to actually “think Perl”. After all, when you’re programming, you don’t write a bunch of expressions, then a bunch of subroutines, then a bunch of objects. You have to go at everything all at once, more or less. So this chapter is a bit like that.
There is, however, a rudimentary organization to the chapter in that we’ll start with the negative advice and work our way toward the positive advice. We don’t know if that will make you feel any better, but it makes us feel better. Besides, for most of your programming career, you’ll spend your time learning what not to do before you figure out what to do, so get used to it early.
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access