1Term::Size::Any(3)    User Contributed Perl Documentation   Term::Size::Any(3)
2
3
4

NAME

6       Term::Size::Any - Retrieve terminal size
7

SYNOPSIS

9           # the traditional way
10           use Term::Size::Any qw( chars pixels );
11
12           ($columns, $rows) = chars *STDOUT{IO};
13           ($x, $y) = pixels;
14

DESCRIPTION

16       This is a unified interface to retrieve terminal size.  It loads one
17       module of a list of known alternatives, each implementing some way to
18       get the desired terminal information. This loaded module will actually
19       do the job on behalf of "Term::Size::Any".
20
21       Thus, "Term::Size::Any" depends on the availability of one of these
22       modules:
23
24           Term::Size           (soon to be supported)
25           Term::Size::Perl
26           Term::Size::ReadKey  (soon to be supported)
27           Term::Size::Win32
28
29       This release fallbacks to Term::Size::Win32 if running in Windows 32
30       systems. For other platforms, it uses the first of Term::Size::Perl,
31       Term::Size or Term::Size::ReadKey which loads successfully. (To be
32       honest, I disabled the fallback to Term::Size and Term::Size::ReadKey
33       which are buggy by now.)
34
35   FUNCTIONS
36       The traditional interface is by importing functions "chars" and
37       "pixels" into the caller's space.
38
39       chars
40               ($columns, $rows) = chars($h);
41               $columns = chars($h);
42
43           "chars" returns the terminal size in units of characters
44           corresponding to the given filehandle $h.  If the argument is
45           ommitted, *STDIN{IO} is used.  In scalar context, it returns the
46           terminal width.
47
48       pixels
49               ($x, $y) = pixels($h);
50               $x = pixels($h);
51
52           "pixels" returns the terminal size in units of pixels corresponding
53           to the given filehandle $h.  If the argument is ommitted,
54           *STDIN{IO} is used.  In scalar context, it returns the terminal
55           width.
56
57           Many systems with character-only terminals will return "(0, 0)".
58

SEE ALSO

60       It all began with Term::Size by Tim Goodwin. You may want to have a
61       look at:
62
63           Term::Size
64           Term::Size::Perl
65           Term::Size::Win32
66           Term::Size::ReadKey
67

BUGS

69       Please reports bugs via CPAN RT, via web
70       http://rt.cpan.org/NoAuth/Bugs.html?Dist=Term-Size-Any or e-mail to
71       bug-Term-Size-Any@rt.cpan.org.
72

AUTHOR

74       Adriano R. Ferreira, <ferreira@cpan.org>
75
77       Copyright (C) 2008 by Adriano R. Ferreira
78
79       This library is free software; you can redistribute it and/or modify it
80       under the same terms as Perl itself.
81
82
83
84perl v5.12.0                      2008-01-28                Term::Size::Any(3)
Impressum