in reply to Pipes? Child Processes?

I'm not going to say much about children because the previous posts provide quite alot of info. To understand pipes you need to know a bit about the unix programming philosopy. A typical unix distribution comes with a lot of small programs that do one thing really well. For example, cat streams the contents of a file, grep matches patterns, less allows you to browse text, gzip compresses files, etc. Pipes allow you to "pipe" the output of one program to the input of another in a rather transparent way. Each program's input and output is always being piped somewhere. The shell pipes your keyboard input to the program you are currently running, and captures your program's output to send to the terminal. You can think of unix as a system of little black boxes that all do one thing. There are a bunch of pipes lying around that can be connected between the black boxes however you wish. By rewiring the pipes, you can create a multitude of complex behaviors out of a collection of simple machines.

You can solve a lot of programming problems on a unix system simply by piping a bunch of small programs together. For example, if I wanted to find all the connections to my web server from ip 216.122.66.112 I might write this perl script:

open IN, "<access.log" or die; while (<IN>) { print if $_ =~ /^216\.122\.66\.112/; } close IN;
But say I want to be able to browse these results in less. I'd have to write my output to a file and then call less on that file. Or I could do this in the shell:
% grep '^216\.122\.66\.112' access.log | less -S
Or I could pipe the output of my perl program to less. Rewriting less in perl would be a real pain, but any program can allow the user to browse its output with less with the help of a pipe. It's very nice to be able to pipe output from another process into your perl program so you don't have to continually reinvent the wheel.

If you want to learn more about this sort of thing, I'd suggest picking up a good general unix reference as a first step. For example, W. Richard Stevens has written a number of great unix books, covering topics from interprocess communication to network programming. Once you have a handle on unix interprocess communication, chapter 16 of the Perl Cookbook will provide you with most of what you need to know about the how in Perl.