T
toylet
In most perl examples, it used this method to trap error:
open(INFILE, $fname) or die "Unable to open $fname";
process_file();
close(INFILE)
other_codes();
Now that if I don't want to die after the open so as to run
other_codes()? Could I test the value of file handle INFILE like what I
did with C?
fhandle=fopen(fname,"r")
if (fhandle > 0) {
process_file();
fclose(fhandle)
}
else
show_error()
other_codes();
open(INFILE, $fname) or die "Unable to open $fname";
process_file();
close(INFILE)
other_codes();
Now that if I don't want to die after the open so as to run
other_codes()? Could I test the value of file handle INFILE like what I
did with C?
fhandle=fopen(fname,"r")
if (fhandle > 0) {
process_file();
fclose(fhandle)
}
else
show_error()
other_codes();