I would follow most of the above advice, with the added good behavior of comparing against
$/ instead of
"\n". Even if the delimeter for what you're reading changes, a blank "record" is still blank that way. Moreover, if the code is moved to a socket or equivelent, it gets worse.
See perlvar for $/, and perlipc for why.