my $foo; open ($foo, $foo_file) || die "Could not open $foo_file\n"; DoStuffOnHandle($foo); close ($foo);