in reply to How to get rid of a TopLevel window

Assuming that you want to get rid of the entire window (not just the frame widget inside the window), you need to destroy the top-level window, like so:

$toplevel->destroy;