in reply to Gui's being difficult

exit is just that, it is designed to exit the program. What you need to look for is a subroutine to destroy the window. You don't mention what you are using for a GUI, but assuming it's Tk, something like command => $widget->destroy(); should work.

Update of course, if you would like this to actually work you should probably use command => sub{ $widget->destroy() } as tye most kindly points out below. (Sorry, it's been many months since I last looked at Tk)

Replies are listed 'Best First'.
(tye)Re: Gui's being difficult
by tye (Sage) on Jun 07, 2001 at 10:16 UTC

    Don't you mean command => sub { $widget->destroy() }? Otherwise the widget will be destroyed when you declare the button, rather than when you click it.

            - tye (but my friends call me "Tye")