I don't if the string end with line , I am giving the output as it is and trying to print the line as it is then next to the line I need to write valid or not valid . how ever if I try to type valid next to the line it will go to the next line no matter what I do :
then chomp is working and my previous post stands. Answer the questions in my previous post if you want to find the problem. I've just added code snippets in that post to help you answer the questions.