@data=; <-- Puts the whole file in @data while() <-- There's nothing left to read here.