open FOO, $file # and not open FOO, $file or die_nice( "Can't open $foo, Perl says $!\n"); sub die_nice { print "Content-Type: text/html\n\n" . shift; }