Maybe Tk catches exit? You could try POSIX::exit instead.
In reply to Re: How to hide exit and die by Corion in thread How to hide exit and die by mnooning