As far as I can deduce from your program (which isn't inside of <code> tags, so very hard to read), @raw will be assigned the current line. @raw will never contain more than one line. Finally, when all input is seen, @raw is printed. And hence, will print the final line of the input.