On Tue, Dec 22, 2009 at 4:29 PM, Michael G Schwern <schw...@pobox.com> wrote: > A little experimentation with a small disk image shows that close() will > error if there's no disk left. No need to check every print. And a close()
You have to check every print. Most prints will just extend the buffer but some prints will flush the buffer and return a real success/failure. You can't predict in advance unless you can predict that you won't have printed a buffer's full. The repeated "or croak" or "or die" is unfortunate and could easily be refactored. I find it easy to resist that urge withing EU::MM because it is so important and avoiding breaking it is so incredibly important. It would be reasonable to take the diff I've generated to generate a new diff reading something like: $fh->print( ... ); You've got full freedom to assert some policies like "we'll complain bitterly if we run out of disk." Josh