use strict; sub IO::Handle::DESTROY { my $self = shift; warn +(caller 0)[3]."($self)\n"; close $self or die "$!\n"; } { if( open my $fh, ">", "/dev/full" ) { print { $fh } 1 } } warn "Terminating\n"; __END__ IO::Handle::DESTROY(IO::Handle=IO(0x8130c0c)) Terminating