in reply to Problems with perl/Tk dialogbox destroy
The Dialog and DialogBox widgets behave strangly when it comes to destroying them. I would recommend using a Toplevel instead. I think that would solve most of your problems with only minor changes to the code