The error does occur: if I change the die to a warn, I see the warning. But while die aborts execution (statements after it will not run), I canít make it throw an exception. The conditions from Carping in DESTROY, which was mentioned in another subthread, do not apply either.

You can, of course, adjust the arguments list to make exit() return a failure code to the OS. Unfortunately, that's not going to get caught as an exception, though.

This leaves some possibilities, although none are spectacular if you were counting on catching the die(). You could certainly set a flag before the exit and have final clean-up triggered by an END block if that flag is set. You could call the cleanup right from there in the destructor and exit from the cleanup code. If there's ever a reason not to leave the program on the full disk error, you could trigger your complaining/cleanup code in there and continue.

Depending on how much state you want to handle, you can work around the die getting caught lots of ways. Here's one that works in toy testing, and lets you use it as a module:

You can make the END block do whatever you need it to do to complain/cleanup. Just put use Foo; at the top of your program, and any failed file close triggers exit and what ever's in your END block. For that matter, since setting IO::Handle::DESTROY in the module seems to work pretty well, you could just put your cleanup code in there, too.