in reply to chomp not working

What do you mean by "chomp [is] not working"? chomp removes \n (or whatever $/ holds) form the end of the string, if present.

I'd say the likelyhood of chomp not working is nil. The following questions should help you find the real problem:

Update: Added test snippets.

Replies are listed 'Best First'.
Re^2: chomp not working
by Anonymous Monk on Feb 15, 2006 at 22:24 UTC
    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 :
    print "$line valid\n";
    will look somthing like this one % ...... valid
      Run
      $line = "one % : thrre blblblb % 545334\n"; chomp($line); print "$line valid\n";

      If you get

      one % : thrre blblblb % 545334 valid

      then someting is really wrong with your perl.

      If you get,

      one % : thrre blblblb % 545334 valid

      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.