Help for this page

Select Code to Download


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