sub Button_Click { while(1){ # do something... Win32::GUI::DoEvents(); } return 1; }