http://www.perlmonks.org?node_id=836512


in reply to Re: socket help
in thread socket help

FWIW, this could also be achieved by saying

print scalar <$fh>;

(the <> operator (aka readline) behaves differently depending on context — which by default is "list" with print)