Term::Table::Util(3)
π Term::Table::Util
okay so bestie, welcome to Term::Table::Util(3) β the little sidekick module that Term::Table leans on. It's in the User Contributed Perl Documentation corner of the man pages, and honestly? It's iconic for how much it does with so little. π
β¨ NAME β¨
Term::Table::Util β Utilities for Term::Table. that's it, that's the whole vibe. π«Ά
πΈ DESCRIPTION πΈ
This package exports some tools used by Term::Table. lowkey just a little grab-bag of helpers the main module reaches for, no cap. π
π EXPORTS π
β CONSTANTS β
these are the two lil booleans you can import, and they're basically vibe checks for what's installed on your system π₯
$bool = USE_GCSβ True ifUnicode::GCStringis installed. so if your box is fancy enough to have it, this is all1and happy. β¨$bool = USE_TERM_READKEYβ True ifTerm::ReadKeyis installed. same deal, just a yes/no on whether that module is chilling in your@INC. π
π¦ UTILITIES π¦
the actual functional girlies of the module π
$width = term_size()β Get the width of the terminal. literally just "how many columns we working with rn" π
If the $TABLE_TERM_SIZE environment variable is set then that value will be returned. so like, you can just override it yourself if you want, main character behaviour honestly. π
This will default to 80 if there is no good way to get the size, or if the size is unreasonably small. bc a 3-column terminal is not giving usable output bestie π
If Term::ReadKey is installed it will be used. (that's where USE_TERM_READKEY from up top comes in, iykyk π)
$width = uni_length($string)β Get the width (in columns) of the specified string. WhenUnicode::GCStringis installed this will work on unicode strings, otherwise it will just uselength($string). so like, with the fancy module you get actual column widths for the emoji-and-grapheme girlies πΈπ§, and without it you get plain old character count. know the difference, fr fr π
π SOURCE π
The source code repository for Term-Table can be found at http://github.com/exodist/Term-Table/. go star it, it's free and it slays β
π«Ά MAINTAINERS π«Ά
Chad Granum <exodist@cpan.org> β the one holding it down π
π AUTHORS π
Chad Granum <exodist@cpan.org> β yes same person, he's carrying the whole team and we love that for him π
π COPYRIGHT π
Copyright 2016 Chad Granum <exodist@cpan.org>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
See http://dev.perl.org/licenses/
periodt. legal stuff said, all facts intact, nothing skipped. π
and that's the whole page bestie!! brought to you by perl v5.42.0, dated 2024-12-28 β it's giving vintage (okay not that vintage π) and it ate, no crumbs left. now go center your tables correctly πβ¨π
π¦ where this page comes from
- opensuse-leap 16.0: perl-Term-Table 0.024-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms