UV::TTY - TTY stream handles in libuv
#!/usr/bin/env perl use strict; use warnings; # A new stream handle will be initialised against the default loop my $tty = UV::TTY->new(fd => 0); # set up the data read callback $tty->on(read => sub { my ($self, $err, $buf) = @_; say "More data: $buf"; }); $tty->read_start();
This module provides an interface to libuv's TTY stream handle.
TTY handles represent a stream for the console.
UV::TTY inherits all events from UV::Stream and UV::Handle.
UV::TTY inherits all methods from UV::Stream and UV::Handle and also makes the following extra methods available.
$tty->set_mode($mode);
The set_mode method sets the mode of the TTY handle, to one of the UV_TTY_MODE_* constants.
UV_TTY_MODE_*
my ($width, $height) = $tty->get_winsize();
The get_winsize method returns the size of the window.
Paul Evans <leonerd@leonerd.org.uk>
This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
To install UV, copy and paste the appropriate command in to your terminal.
cpanm
cpanm UV
CPAN shell
perl -MCPAN -e shell install UV
For more information on module installation, please visit the detailed CPAN module installation guide.