Part IV. Programming Techniques

Chapter 28

Chapter 29

Chapter 30

Chapter 31

Chapter 32

Chapter 33

Chapter 34

Chapter 35

Chapter 36

Chapter 37

The ten articles in Part III, Computer Science covered topics that can be applied to all modern programming languages; in this section, ten articles explore some Perl-specific programming techniques. Mark Jason Dominus begins with Suffering from Buffering. In his own words:

I got tired of hearing people ask in newsgroups and on IRC why their web page output was in the wrong order, so I wrote this article explaining the buffering behavior of the standard I/O library. Those questions still come up, and when someone on IRC asks, “Why is my output coming out in the wrong order?” I get a big charge out of giving them the URL for this article and saying, “Look in the section titled “Why is my output coming out in the wrong order?’”

Mark Jason follows with two articles on scoping. Scoping explains the difference between my and local, and why you should prefer my; Seven Useful Uses of local explores the unusual situations in which you really do want to use local.

Next, Johan Vromans demonstrates a few techniques for creating programs that provide command-line switches for their users, and Dan Schmidt follows with a lucid article on how he came to realize that he needed a data type that Perl didn’t offer, and how he created it.

Perl lets you declare actions to be taken as your program is being compiled (and before it is run). For instance, when you say use lib '/home/my_perl_modules' ...

Get Computer Science & Perl Programming 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.