in reply to How do I pipe the output of a Perl program to something else?

A few other tips. When you take input from the keyboard you probably want to output a prompt to the user. This looks a bit dumb if the user redirected the input from a file (< in the shell) or another program using a pipe (prog|yours.pl). You can test if STDIN (or any other file handle) is connected to a terminal with:
if (-t STDIN) { # output prompt }
This is also useful before you pipe to more(1). You can pipe to more(1) from within your program automatically if connected to a terminal:
my $old_handle; if (-t STDOUT) { open (MORE, "| more") or die "No more $!\n"; $old_handle = select MORE; }
At the end of the program:
END { if (defined $old_handle) { select $old_handle; close MORE; } }