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


in reply to socket help

Sorry! Posted in curiosity. But, now I've found. It is because of
print <$fh>;
Need to do like this.
$var = <fh>; print $var;

When we do something like 'print <fh>' it reads till EOF and prints entire content. Since, I've tried in sockets, I wouldn't have received EOF. So, the above code didn't work as expected.