close() or die

From: John Bokma (postmaster_at_castleamber.com)
Date: 12/31/04


Date: 31 Dec 2004 16:54:18 GMT

Recently a customer reported that a Perl script I had written suddenly
reported an error.

It turned out that it failed on the close (it died and reported that the
close failed after writing to the file).

It turned out that his disk quota had exceeded. So it seems that the close
flushed the buffer, which failed, and my script nicely reported this.

Bottomline: check your close. Without this it would have not been obvious.
Even if I use auto-vivication, I close explicitly.

-- 
John                   Small Perl scripts: http://johnbokma.com/perl/
               Perl programmer available:     http://castleamber.com/
            Happy Customers: http://castleamber.com/testimonials.html
                        


Relevant Pages

  • Re: Problem with fetching LONGs and LONG RAWs (ORA-01062)
    ... This perl script illustrates a strange problem while fetching ... ORA-01062: unable to allocate memory for define buffer (DBD ERROR: ... Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - Prod ...
    (perl.dbi.users)
  • Re: Cannot read from STDIN
    ... > Perl script in question: http://mkmxg00/cgi/confirmUpload.pl is as ... > use CGI; ... > my $buffer; ... > I have already invoked confirmUpload.pl with the XMLHttpRequest confirmReq ...
    (comp.lang.perl.misc)
  • Cannot read from STDIN
    ... Perl script in question: http://mkmxg00/cgi/confirmUpload.pl is as ... # add code that reads in the "Confirm Modifications" request from the CGI buffer ... } var confirmReq; ...
    (comp.lang.perl.misc)
  • Re: Getting the data in the buffer
    ... >> Say I'd like to run a Perl script that acts on this data in the buffer. ... carriage return in it, no? ...
    (comp.lang.perl.misc)
  • Re: Getting the data in the buffer
    ... > Say I'd like to run a Perl script that acts on this data in the buffer. ... > How would I load that data into a variable? ...
    (comp.lang.perl.misc)