$handle->push_write("1") $handle->push_write(sub { my $h = shift; $h->unshift_write("2"); return 1; }); $handle->push_write("3"); # The output will be "123" push_sendfile($filename, [$size, [$offset]]); Push sendfile operation into write queue. If sendfile cannot be found (Sys::Sendfile) or if it fails with one of ENOSYS, ENOTSUP, EOPNOTSUPP, EAFNOSUPPORT, EPROTOTYPE or ENOTSOCK, it will be emulated with chunked read/write $handle->push_write("HTTP/1.0 200 OK\nContent-length: $size\n...\n\n"); $handle->push_sendfile($file, $size, $offset);
ACKNOWLEDGEMENTS AUTHOR Mons Anderson, "<mons at cpan.org>"
LICENSE This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
To install AnyEvent::Handle::Writer, copy and paste the appropriate command in to your terminal.
cpanm
cpanm AnyEvent::Handle::Writer
CPAN shell
perl -MCPAN -e shell install AnyEvent::Handle::Writer
For more information on module installation, please visit the detailed CPAN module installation guide.