use Win32::API; sub EWX_LOGOFF () {0} sub EWX_SHUTDOWN () {0x00000001} sub EWX_REBOOT () {0x00000002} sub EWX_FORCE () { 0x00000004} sub EWX_POWEROFF () {0x00000008} sub EWX_FORCEIFHUNG () {0x00000010} $ExitWindows = new Win32::API ('kernel32','ExitWindowsEx', ['L','L'], 'L'); $ExitWindows->Call(EWX_REBOOT,0);