for line in io.lines() do if line == "42" then return end print(line) end
Lua 5.1 would be appreciated