AnyEvent-ReadLine-Gnu
view release on metacpan or search on metacpan
$self->{point} = $saved_point;
$self->redisplay;
}
$rw = AE::io $in, 0, sub {
$self->rl_callback_read_char;
};
}
=item $rl->print ($string, ...)
=item AnyEvent::ReadLine::Gnu->print ($string, ...)
Prints the given strings to the terminal, by first hiding the readline,
printing the message, and showing it again.
This function can be called even when readline has never been initialised.
The last string should end with a newline.
=cut
sub print {
shift;
hide;
my $out = $out || *STDOUT;
print $out @_;
show;
}
END {
return unless $self;
$self->hide;
$self->callback_handler_remove;
}
1;
=back
=head1 CAVEATS
There are some issues with readline that can be problematic in event-based
programs:
=over 4
=item blocking I/O
Readline uses blocking terminal I/O. Under most circumstances, this does
not cause big delays, but ttys have the potential to block programs
indefinitely (e.g. on XOFF).
=item unexpected disk I/O
By default, readline does filename completion on TAB, and reads its
config files.
Tab completion can be disabled by calling C<< $rl->unbind_key (9) >>.
=item tty settings
After readline has been initialised, it will mangle the termios tty
settings. This does not normally affect output very much, but should be
taken into consideration.
=item output intermixing
Your program might wish to print messages (for example, log messages) to
STDOUT or STDERR. This will usually cause confusion, unless readline is
hidden with the hide method.
=back
Oh, and the above list is probably not complete.
=head1 AUTHOR, CONTACT, SUPPORT
Marc Lehmann <schmorp@schmorp.de>
http://software.schmorp.de/pkg/AnyEvent-ReadLine-Gnu.html
=head1 SEE ALSO
L<rltelnet> - a simple tcp_connect-with-readline program using this module.
=cut
( run in 0.848 second using v1.01-cache-2.11-cpan-2398b32b56e )