- or download this
open (FILE, "file") || die "file could not be opened";
- or download this
$file = "some_file.txt";
open(FILE,"$file") or &Error($!);
- or download this
sub Error {
$error = shift or $error = "unknown";
...
print "Error: $error";
&End;
}
- or download this
close FILE or die "Could not close $file";