|
NAMETerm::Choose::LineFold VERSIONVersion 1.775 DESCRIPTIONWidth in this context refers to the number of occupied columns of a character string on a terminal with a monospaced font. By default ambiguous width characters are treated as half width. If the environment variable "TC_AMBIGUOUS_WIDTH_IS_WIDE" is set to a true value, ambiguous width characters are treated as full width. If the optional Term::Choose::LineFold::XS module is installed, its functions will be used automatically in place of the pure-Perl implementations, providing faster performance. EXPORTNothing by default. use Term::Choose::LineFold qw( print_columns ); FUNCTIONSprint_columnsGet the number of occupied columns of a character string on a terminal. The string passed to this function is a decoded string, free of control characters, non-characters, and surrogates. $print_width = print_columns( $string ); line_foldFold a string. This function accepts a decoded string. Control characters (excluding vertical spaces), non-characters, and surrogates are removed before the string is folded. Changes are applied to a copy; the passed string is unchanged. $folded_string = line_fold( $string );
$folded_string = line_fold( $string, { width => 120, color => 1 } );
Options
AUTHORMatthäus Kiem <cuer2s@gmail.com> LICENSE AND COPYRIGHTCopyright (C) 2025 Matthäus Kiem. This library is free software; you can redistribute it and/or modify it under the same terms as Perl 5.10.0. For details, see the full text of the licenses in the file LICENSE.
|