Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

Re^3: selecting from a number of different input sources.

by almut (Canon)
on Jul 21, 2010 at 17:40 UTC ( #850692=note: print w/ replies, xml ) Need Help??


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...


Comment on Re^3: selecting from a number of different input sources.
Select or Download Code

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://850692]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (3)
As of 2015-07-28 06:06 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The top three priorities of my open tasks are (in descending order of likelihood to be worked on) ...









    Results (252 votes), past polls