http://www.perlmonks.org?node_id=1009683


in reply to File open issue

my $tempfile = "$tempdir/$ENV{'REMOTE_ADDR'}";

Quotes on a bareword hash key are redundant.

open (TMPFILE, "$tempfile")|| ($nofile = 1);

You shouldn't quote variables: What's wrong with always quoting "$vars"?    You are adding extra work for perl which has to interpolate the variable and then copy its contents to the string.

Because open returns true on success or false on failure you could simply do:

my $nofile = open TMPFILE, $tempfile;
my (@tmpfile) = <TMPFILE>;

The parentheses are superfluous because an array already provides list context.