in reply to Re: Read the last line in a text file
in thread Read the last line in a text file

This node falls below the community's threshold of quality. You may see it by logging in.
  • Comment on Re^2: Read the last line in a text file

Replies are listed 'Best First'.
Re^3: Read the last line in a text file
by moritz (Cardinal) on Aug 22, 2008 at 12:25 UTC
    Is this related to your previous question? If not, please start a new thread the next time.

    To answer your question, the file from <CHECKBOOK> still have a newline at the end, so the record will never equal to "Uninstall complete.".

    Take a look at chomp.

      This is the other way round I'm trying to solve my problem for my prior question. As you have said chomp, can you please let me know where exactly I have to use the chomp in the above code? (as a novice in perl)

        Did you trying using your own resources to find the answer?

        perldoc -f chomp

        You'll find the documentation that came with your installation will help you learn.

        Well, it's not so hard. At some point you read the line, where it still has the newline. Later you use that line in a comparison, at which point it shouldn't have the newline any more. So where do you need to remove it?

        Also don't be afraid to just try stuff. It really helps.