| 1 |
NAME |
| 2 |
Term::Size::Any - Retrieve terminal size |
| 3 |
|
| 4 |
SYNOPSIS |
| 5 |
# the traditional way |
| 6 |
use Term::Size::Any qw( chars pixels ); |
| 7 |
|
| 8 |
($columns, $rows) = chars *STDOUT{IO}; |
| 9 |
($x, $y) = pixels; |
| 10 |
|
| 11 |
DESCRIPTION |
| 12 |
This is a unified interface to retrieve terminal size. It loads one |
| 13 |
module of a list of known alternatives, each implementing some way to |
| 14 |
get the desired terminal information. This loaded module will actually |
| 15 |
do the job on behalf of `Term::Size::Any'. |
| 16 |
|
| 17 |
Thus, `Term::Size::Any' depends on the availability of one of these |
| 18 |
modules: |
| 19 |
|
| 20 |
Term::Size (soon to be supported) |
| 21 |
Term::Size::Perl |
| 22 |
Term::Size::ReadKey (soon to be supported) |
| 23 |
Term::Size::Win32 |
| 24 |
|
| 25 |
This release fallbacks to Term::Size::Win32 if running in Windows 32 |
| 26 |
systems. For other platforms, it uses the first of Term::Size::Perl, |
| 27 |
Term::Size or Term::Size::ReadKey which loads successfully. (To be |
| 28 |
honest, I disabled the fallback to Term::Size and Term::Size::ReadKey |
| 29 |
which are buggy by now.) |
| 30 |
|
| 31 |
FUNCTIONS |
| 32 |
|
| 33 |
The traditional interface is by importing functions `chars' and `pixels' |
| 34 |
into the caller's space. |
| 35 |
|
| 36 |
chars |
| 37 |
($columns, $rows) = chars($h); |
| 38 |
$columns = chars($h); |
| 39 |
|
| 40 |
`chars' returns the terminal size in units of characters |
| 41 |
corresponding to the given filehandle `$h'. If the argument is |
| 42 |
ommitted, `*STDIN{IO}' is used. In scalar context, it returns the |
| 43 |
terminal width. |
| 44 |
|
| 45 |
pixels |
| 46 |
($x, $y) = pixels($h); |
| 47 |
$x = pixels($h); |
| 48 |
|
| 49 |
`pixels' returns the terminal size in units of pixels corresponding |
| 50 |
to the given filehandle `$h'. If the argument is ommitted, |
| 51 |
`*STDIN{IO}' is used. In scalar context, it returns the terminal |
| 52 |
width. |
| 53 |
|
| 54 |
Many systems with character-only terminals will return `(0, 0)'. |
| 55 |
|
| 56 |
SEE ALSO |
| 57 |
It all began with Term::Size by Tim Goodwin. You may want to have a look |
| 58 |
at: |
| 59 |
|
| 60 |
Term::Size |
| 61 |
Term::Size::Perl |
| 62 |
Term::Size::Win32 |
| 63 |
Term::Size::ReadKey |
| 64 |
|
| 65 |
BUGS |
| 66 |
Please reports bugs via CPAN RT, via web |
| 67 |
http://rt.cpan.org/NoAuth/Bugs.html?Dist=Term-Size-Any or e-mail to |
| 68 |
[email protected]. |
| 69 |
|
| 70 |
AUTHOR |
| 71 |
Adriano R. Ferreira, <[email protected]> |
| 72 |
|
| 73 |
COPYRIGHT AND LICENSE |
| 74 |
Copyright (C) 2008-2012 by Adriano R. Ferreira |
| 75 |
|
| 76 |
This library is free software; you can redistribute it and/or modify it |
| 77 |
under the same terms as Perl itself. |
| 78 |
|