note
almut
<p> It's not immediately clear from the docs, but just saying <c>use IO::Handle</c> entitles you to call IO::Handle methods on normal file handles like your already opened <c>$fh</c>. In other words, your snippet could be simplified as follows: </p>
<c>
use IO::Handle;
open (my $fh, '<', $FILE) or die $!;
# then simply call method from IO::Handle
$fh->getline();
</c>
<p> This doesn't answer the question how to make a socket out of a regular file, but I thought it's worth mentioning nevertheless... </p>
850549
850684