POE::Driver - perform IO on a filehandle
$driver = new POE::Driver::Derivative(); # create a derivative driver \@input_chunks = $driver->get($handle); # get data from $handle $result = $driver->put($output_chunk); # put data into an output buffer $result = $driver->flush($handle); # flush output buffer to $handle
Derivatives of POE::Driver provide standard IO functions for their parent IO::Sessions. For example, POE::Driver::SysRW provides basic sysread and syswrite, with buffering and error checking.
POE::Driver
IO::Session
POE::Driver::SysRW
sysread
syswrite
Creates and returns a reference to a new POE::Driver derivative.
Adds $output to the driver's output buffer. See $driver-flush(...)> to find out what happens next. Returns the amount of data in the driver's output buffer after $output has been added.
$output
$driver-
Extracts data from a filehandle. On success, it returns a reference to an array of extracted chunks of information. On failure, it sets $! and returns undef. Some drivers may absorb EAGAIN.
undef
EAGAIN
Attempts to write to $handle a chunk of information buffered by $driver-put(...)>. On success, it returns the amount of data waiting to be written. On failure, it returns undef and sets $!. Some drivers may absorb EAGAIN.
$handle
Please see tests/selects.perl for an example of POE::Driver derivatives.
None known.
Copyright 1998 Rocco Caputo <troc@netrus.net>. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install POE, copy and paste the appropriate command in to your terminal.
cpanm
cpanm POE
CPAN shell
perl -MCPAN -e shell install POE
For more information on module installation, please visit the detailed CPAN module installation guide.