| 1 |
"IO::Callback" provides an easy way to produce a phoney read-only filehandle |
| 2 |
that calls back to your own code when it needs data to satisfy a read. This |
| 3 |
is useful if you want to use a library module that expects to read data from |
| 4 |
a filehandle, but you want the data to come from some other source and you |
| 5 |
don't want to read it all into memory and use IO::String. |
| 6 |
|
| 7 |
use IO::Callback; |
| 8 |
|
| 9 |
my $fh = IO::Callback->new('<', sub { ... ; return $data }); |
| 10 |
my $object = Some::Class->new_from_file($fh); |
| 11 |
|
| 12 |
Similarly, IO::Callback allows you to wrap up a coderef as a write-only |
| 13 |
filehandle, which you can pass to a library module that expects to write its |
| 14 |
output to a filehandle. |
| 15 |
|
| 16 |
my $fh = IO::Callback->new('>', sub { my $data = shift ; ... }); |
| 17 |
$object->dump_to_file($fh); |
| 18 |
|
| 19 |
INSTALLATION |
| 20 |
|
| 21 |
To install this module, run the following commands: |
| 22 |
|
| 23 |
perl Build.PL |
| 24 |
./Build |
| 25 |
./Build test |
| 26 |
./Build install |
| 27 |
|
| 28 |
SUPPORT AND DOCUMENTATION |
| 29 |
|
| 30 |
After installing, you can find documentation for this module with the |
| 31 |
perldoc command. |
| 32 |
|
| 33 |
perldoc IO::Callback |
| 34 |
|
| 35 |
You can also look for information at: |
| 36 |
|
| 37 |
RT, CPAN's request tracker |
| 38 |
http://rt.cpan.org/NoAuth/Bugs.html?Dist=IO::Callback |
| 39 |
|
| 40 |
AnnoCPAN, Annotated CPAN documentation |
| 41 |
http://annocpan.org/dist/IO::Callback |
| 42 |
|
| 43 |
CPAN Ratings |
| 44 |
http://cpanratings.perl.org/d/IO::Callback |
| 45 |
|
| 46 |
Search CPAN |
| 47 |
http://search.cpan.org/dist/IO::Callback |
| 48 |
|
| 49 |
|
| 50 |
COPYRIGHT AND LICENCE |
| 51 |
|
| 52 |
Copyright 1998-2005 Gisle Aas. |
| 53 |
|
| 54 |
Copyright 2009-2010 Dave Taylor. |
| 55 |
|
| 56 |
This program is free software; you can redistribute it and/or modify it |
| 57 |
under the same terms as Perl itself. |
| 58 |
|