Subject: Re: [htdig] (horribly-off-topic) Dummy files in Perl?
From: Adam Rice (firstname.lastname@example.org)
Date: Wed Mar 29 2000 - 00:40:50 PST
> Is Perl's behavior specified when I try to write into (ie using the PRINT
> statement) a file variable which has never been opened?
Yes. It does nothing, unless you're running with the -w option, in which
it generates a warning.
> I'd like it to simply discard the output; can I rely upon this happening?
As long as some other part of your program isn't using the same
yes. For robustness, I would recommend running with -w and using
open(FILEHANDLE, ">/dev/null") || die "Couldn't open /dev/null ($!)\n";
assuming you're on Unix.
Apologies to the htdiggers for polluting this forum with Perliness.
To unsubscribe from the htdig mailing list, send a message to
You will receive a message to confirm this.
This archive was generated by hypermail 2b28 : Tue Mar 28 2000 - 23:40:45 PST