1 | package AnyEvent::Handle; |
1 | package AnyEvent::Handle; |
2 | |
2 | |
3 | use warnings; |
3 | no warnings; |
4 | use strict; |
4 | use strict; |
5 | |
5 | |
6 | use AnyEvent; |
6 | use AnyEvent; |
7 | use IO::Handle; |
7 | use IO::Handle; |
8 | use Errno qw/EAGAIN EINTR/; |
8 | use Errno qw/EAGAIN EINTR/; |
… | |
… | |
93 | |
93 | |
94 | These are shortcuts, that will call the corresponding method and set the callback to C<$cb>. |
94 | These are shortcuts, that will call the corresponding method and set the callback to C<$cb>. |
95 | |
95 | |
96 | =item on_readline => $cb |
96 | =item on_readline => $cb |
97 | |
97 | |
98 | The C<readlines> method is called with the default seperator and C<$cb> as callback |
98 | The C<readlines> method is called with the default separated and C<$cb> as callback |
99 | for you. |
99 | for you. |
100 | |
100 | |
101 | =back |
101 | =back |
102 | |
102 | |
103 | =cut |
103 | =cut |
… | |
… | |
255 | |
255 | |
256 | =item B<readlines ($callback)> |
256 | =item B<readlines ($callback)> |
257 | |
257 | |
258 | =item B<readlines ($sep, $callback)> |
258 | =item B<readlines ($sep, $callback)> |
259 | |
259 | |
260 | This method will read lines from the filehandle, seperated by C<$sep> or C<"\n"> |
260 | This method will read lines from the filehandle, separated by C<$sep> or C<"\n"> |
261 | if C<$sep> is not provided. C<$sep> will be used as "line" seperator. |
261 | if C<$sep> is not provided. C<$sep> will be used as "line" separated. |
262 | |
262 | |
263 | The C<$callback> will be called when at least one |
263 | The C<$callback> will be called when at least one |
264 | line could be read. The first argument to the C<$callback> will be the L<AnyEvent::Handle> |
264 | line could be read. The first argument to the C<$callback> will be the L<AnyEvent::Handle> |
265 | object itself and the rest of the arguments will be the read lines. |
265 | object itself and the rest of the arguments will be the read lines. |
266 | |
266 | |