What do you mean by losing the line? That it does not print or that it does not get stored in @ref? Consider the following suggestions:
- Use tell to remember the position in the file before you read each line, and use seek to reposition the pointer to there before calling SubOut
- Print $line before calling SubOut or pass $line to SubOut and push it onto @ref there
But God demonstrates His own love toward us, in that while we were yet sinners, Christ died for us. Romans 5:8 (NASB)