Hi Monks!
I am debugging a script and found on this part of the code where it is assigning a variable if the file can't be opened, if I use "die" the code dies, but without using "die" it does what it supposed to do but I get a warning message. My question is if there is a better way to do this, because I need to use the "die" on the "open" file code.
Here is the peace of the code I am talking about.
my $nofile;
my $tempfile = "$tempdir/$ENV{'REMOTE_ADDR'}";
open (TMPFILE, "$tempfile")|| ($nofile = 1);
my (@tmpfile) = <TMPFILE>;
close TMPFILE;