while (1) { # 100 as to try and make room for other things to happen # as if it is non-blocking if ($CLIP->WaitForChange(100) == 1) { $clipboard = $CLIP->Get(); } }