in reply to looping prob

how do i set this timer
perldoc -f sleep
and i want this loop to be infinite
while (1) { ... }
how can i exit out of it on the prompt
perldoc -q 'check whether input is ready'