in reply to New to Perl. How to loop!
could you please put <code> ...</code> around your code?
It's unreadable and therefor (unfortunately) quite unlikely that you'll get much help! 8)
HTH
Cheers Rolf