while (<>){ last if !/\S/; ... }