% perl -Mautodie /tmp/buggy Name "main::OUTPUT_FILE" used only once: possible typo at /tmp/buggy line 16. Can't close filehandle 'OUTPUT_FH': 'Bad file descriptor' at /tmp/buggy line 19 #### use vars qw($fh); undef $fh; open($fh, "> /tmp/data.$$") || die "can't open /tmp/data.$$: $!"); print $fh "I am so NOT a lexical filehandle.\n"; close($fh) || die "can't close /tmp/data.$$: $!"; #### my $fh = *STDOUT; print $fh "I am SO TOO lexical filehandle.\n";