Hi people.
I have a script that, for example, opens a output log file at the start of its execution.
If the script should die at any stage (bad parameters, cant find file..) is there a close function that will close any files I had opened?
#!/perl
open (DEBUG, ">> /tmp/debug.log");
if (!$ARGV[0]){
die "no arguments!";
}
else{
print "hello\n";
}
close DEBUG;
if there are no params supplied, the script will die, and the file won't have been closed.. is there an END {} sub?