1Perl(3) User Contributed Perl Documentation Perl(3)
2
3
4
6 Term::Size::Perl - Perl extension for retrieving terminal size (Perl
7 version)
8
10 use Term::Size::Perl;
11
12 ($columns, $rows) = Term::Size::Perl::chars *STDOUT{IO};
13 ($x, $y) = Term::Size::Perl::pixels;
14
16 Yet another implementation of "Term::Size". Now in pure Perl, with the
17 exception of a C probe run on build time.
18
19 FUNCTIONS
20 chars
21 ($columns, $rows) = chars($h);
22 $columns = chars($h);
23
24 "chars" returns the terminal size in units of characters
25 corresponding to the given filehandle $h. If the argument is
26 omitted, *STDIN{IO} is used. In scalar context, it returns the
27 terminal width.
28
29 pixels
30 ($x, $y) = pixels($h);
31 $x = pixels($h);
32
33 "pixels" returns the terminal size in units of pixels corresponding
34 to the given filehandle $h. If the argument is omitted, *STDIN{IO}
35 is used. In scalar context, it returns the terminal width.
36
37 Many systems with character-only terminals will return "(0, 0)".
38
40 It all began with Term::Size by Tim Goodwin. You may want to have a
41 look at:
42
43 Term::Size
44
45 Term::Size::Win32
46
47 Term::Size::ReadKey
48
49 Please reports bugs via GitHub,
50 <https://github.com/aferreira/cpan-Term-Size-Perl/issues>. When
51 reporting bugs, it may be helpful to attach the Params.pm generated by
52 the probe at build time.
53
55 Adirano Ferreira, <ferreira@cpan.org>
56
58 Copyright (C) 2006-2007, 2017-2018 by Adriano Ferreira
59
60 This library is free software; you can redistribute it and/or modify it
61 under the same terms as Perl itself.
62
63
64
65perl v5.30.0 2019-07-26 Perl(3)