Tied Filehandles for Nonblocking IO with Object Callbackshttp://search.cpan.org/dist/IO-Event/
IO::Event provides a object-based callback system for handling nonblocking
IO. The design goal is to provide a system that just does the right thing
w/o the user needing to think about it much.
All APIs are kept as simple as possible yet at the same time, all
functionality is accesible if needed. Simple things are easy. Hard things
Most of the time file handling syntax will work fine: '' and
'print $filehandle 'stuff''.
IO::Event provides automatic buffering of output (with a callback to
throttle). It provides automatic line-at-a-time input.
After initial setup, call 'IO::Event::loop()'.
IO::Event was originally written to use the Event manpage. IO::Event still
defaults to using the Event manpage but it can now use the AnyEvent manpage
or its own event loop.