| IO-Mux documentation | view source | Contained in the IO-Mux distribution. |
IO::Mux::File::Read - write to file
IO::Mux::File::Read is a IO::Mux::Handler::Read is a IO::Mux::Handler
my $mux = IO::Mux::Select->new; # or ::Poll
use IO::Mux::Open '<';
my $file = $mux->open('<', $filename);
use IO::Mux::File::Read;
my $file = IO::Mux::File::Read->new(file => $filename);
$mux->add($file);
$file->getline(sub {print "\n"});
In an event driven program, reading is harder to use than writing: the read will very probably be stalled until data has arrived, so you will need a callback to handle the resulting data.
-Option --Defined in --Default exclusive <false> fh IO::Mux::Handler <required> file <required> mode '<' modeflags <undef> name IO::Mux::Handler '<$file' read_size IO::Mux::Handler::Read 32768
For now, the mode is always simply
When defined, the exclusive option is not used, but your value is
taken. Use constants defined by Fcntl.
Do not forget to include O_NONBLOCK.
The bits of the open mode.
This module is part of IO-Mux distribution version 0.11, built on January 26, 2011. Website: http://perl.overmeer.net/ All modules in this suite: Any::Daemon, IO::Mux, and IO::Mux::HTTP.
Please post questions or ideas to perl@overmeer.net
Copyrights 2011 by Mark Overmeer. For other contributors see ChangeLog.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. See http://www.perl.com/perl/misc/Artistic.html
| IO-Mux documentation | view source | Contained in the IO-Mux distribution. |