in reply to How to chomp the last new line character from the file

Try chomping the last line. Or if you are sure the last character in the file is to be deleted, you can truncate the file to $size - 1.