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


in reply to Re^2: selecting from a number of different input sources.
in thread selecting from a number of different input sources.

It's not immediately clear from the docs, but just saying use IO::Handle entitles you to call IO::Handle methods on normal file handles like your already opened $fh.  In other words, your snippet could be simplified as follows:

use IO::Handle; open (my $fh, '<', $FILE) or die $!; # then simply call method from IO::Handle $fh->getline();

This doesn't answer the question how to make a socket out of a regular file, but I thought it's worth mentioning nevertheless...