in reply to Why does this code continue to loop?

Hi

three questions:

Why do you sleep 1 ?

Why do you think it's looping infinitely?

Why do you expect help without proper indentation of your code?

update

See Perltidy or consider a decent editor.

Cheers Rolf
(addicted to the Perl Programming Language and ☆☆☆☆ :)
Je suis Charlie!