in reply to I am a beginner for perl

You have a logic problem. The next prevents you from evaluating the until, which in turn prevents you from reaching the print. What are you really trying to do?