Hi,
I commonly make use of statements like: print OUTFILE "Print
results, data, or anything else\n";
This is normally preceded by defining my file handle, as in something
like: open(OUTFILE, ">newfile.txt");
I'd like to know what *actually* happens internally if the filehandle,
OUTFILE in this case, is not defined ahead of time?
The output is shut off, but I would like to know if this is a good way
to control output.
Does perl spend time attempting to print to nowhere?
Or does print (or printf for that matter) recognize that no such
filehandle exists and quit?
As part of a program I'm writing, I would prefer that it quit if the
filehandle is undefined. I want the user to specify between 2 levels
output verbosity, but would rather not have to pepper conditionals for a
sentinel flag variable before each print statement (unless this is the
fastest in terms of efficient performance).
If anyone can clarify this, I would be grateful.
thank-you,
Avram