in reply to How to select a file handle depending on user options
use the <> operator in while, and it will set $_