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

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.

Replies are listed 'Best First'.
Re^4: Read the last line in a text file
by ganilmohan (Acolyte) on Aug 22, 2008 at 12:28 UTC
    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.