in reply to open, file handles and memory

On every operating system unless you are accumulating memory usage in your loop that pattern will work. Just be careful, operations that impose a list-context on the filehandle will slurp the whole thing into an array. So if memory is an issue, avoid the following kinds of things:
foreach my $line (<FILE>) { # etc } my @lines = sort <FILE>; print <FILE>;
Also it is a picky detail, but I find it very helpful to instead of just dying have the die message contain full context information like it recommends in perlstyle.
open(FILE, "< $file") or die "Cannot read $file: $!";
(Or use Carp and confess() rather than die.)

A probably useless tip. Occasionally you run across a situation where you want to process large files (eg 40 GB each) and Perl does not have large file support compiled in. In that case do your reads like this:

open(FILE, "cat $file |") or die "Cannot read $file: $!";
As long as cat understands large files, Perl understands endless pipes, and this works smoothly.