in reply to Re: File created but blank
in thread File created but blank
Yes, but if open is called with just a FILEHANDLE argument it looks in the (package, not lexical) variable of the same name (in this case $LOGFILE). Not that it's not poor style and this form really should be avoided in new code, but it will work as-is (presuming a suitable use vars qw( $LOGFILE ) / our $LOGFILE or a lack of use strict, of course).
(And the pedantic best practices based recommendation would be open( my $logfh, ">", $LOGFILE ) or die "Can't open '$LOGFILE': $!\n";. </pedant> :)
The cake is a lie.
The cake is a lie.
The cake is a lie.
|
|---|