Dude ... you call &settings from an event handler and $Window2->Dialog(); from &settings. That's asking for trouble. Define all your windows and widgets somewhere. Then call
Win32::GUI::Dialog(); once and only once from the main thread. There has been a recent posting on how to handle more than one window with still just one Dialog() call. Remember, as long as one event handler (like your Settings_Click) is avtive, no other event can get handled. Which may be the reason why your window freezes - since you call Dialog() inside the event handler, that handler routine never returns control to the first Dialog() call. I'm not sure if that's really what happens, I don't have the time to test it.