Text::LineFold(3)
π NAME π
Text::LineFold β Line Folding for Plain Text β¨ (manual page Text::LineFold(3), hiiii π
)
β¨ SYNOPSIS β¨
use Text::LineFold;
$lf = Text::LineFold->new();
# Fold lines
$folded = $lf->fold($string, 'PLAIN');
$indented = $lf->fold(' ' x 8, ' ' x 4, $string);
# Unfold lines
$unfolded = $lf->unfold($string, 'FIXED');
π¦ DESCRIPTION π¦
Okay so Text::LineFold folds or unfolds lines of plain text. It mainly focuses on plain text e-mail messages, and RFC 3676 flowed format is also supported. Itβs giving very specific niche icon behavior, and honestly? Obsessed. π
π«Ά Public Interface π«Ά
πΈ new ([KEY => VALUE, ...]) πΈ
Constructor. For the tea on KEY => VALUE pairs, see the config method. π«Ά
π $self->config (KEY) / $self->config ([KEY => VAL, ...]) π
Instance method. Get or update configuration. Following KEY => VALUE pairs may be specified:
Charset => CHARSETβ character set used to encode string. It may be a string or aMIME::Charsetobject. Default is"UTF-8".Language => LANGUAGEβ along with theCharsetoption, this may be used to define language/region context. Default is"XX". See also"Context"inUnicode::LineBreakoption.Newline => STRINGβ string to be used for newline sequence. Default is"\n".OutputCharset => CHARSETβ character set used to encode result offold()/unfold(). It may be a string or aMIME::Charsetobject. If a special value"_UNICODE_"is specified, result will be Unicode string. Default is the value ofCharsetoption.TabSize => NUMBERβ column width of tab stops. When0is specified, tab stops are ignored. Default is8.BreakIndentβ see"Options"inUnicode::LineBreak.CharMaxβ see"Options"inUnicode::LineBreak.ColMaxβ see"Options"inUnicode::LineBreak.ColMinβ see"Options"inUnicode::LineBreak.ComplexBreakingβ see"Options"inUnicode::LineBreak.EAWidthβ see"Options"inUnicode::LineBreak.HangulAsALβ see"Options"inUnicode::LineBreak.LBClassβ see"Options"inUnicode::LineBreak.LegacyCMβ see"Options"inUnicode::LineBreak.Prepβ see"Options"inUnicode::LineBreak.Urgentβ see"Options"inUnicode::LineBreak.
π¦ $self->fold (STRING, [METHOD]) / $self->fold (INITIAL_TAB, SUBSEQUENT_TAB, STRING, ...) π¦
Instance method. fold() folds lines of string STRING and returns it. Surplus SPACEs and horizontal tabs at end of line are removed, newline sequences are replaced by that specified by Newline option and newline is appended at end of text if it does not exist. Horizontal tabs are treated as tab stops according to TabSize option.
By the first style, following options may be specified for METHOD argument.
"FIXED"β lines preceded by">"wonβt be folded. Paragraphs are separated by empty line."FLOWED"β"Format=Flowed; DelSp=Yes"formatting defined by RFC 3676."PLAIN"β default method. All lines are folded.
Second style is similar to "wrap()" in Text::Wrap. All lines are folded. INITIAL_TAB is inserted at beginning of paragraphs and SUBSEQUENT_TAB at beginning of other broken lines. Slay. π
π§ $self->unfold (STRING, METHOD) π§
Conjunct folded paragraphs of string STRING and returns it.
Following options may be specified for METHOD argument.
"FIXED"β default method. Lines preceded by">"wonβt be conjuncted. Treat empty line as paragraph separator."FLOWED"β unfold"Format=Flowed; DelSp=Yes"formatting defined by RFC 3676."FLOWEDSP"β unfold"Format=Flowed; DelSp=No"formatting defined by RFC 3676.
π BUGS π
Please report bugs or buggy behaviors to developer.
CPAN Request Tracker:
<http://rt.cpan.org/Public/Dist/Display.html?Name=Unicode-LineBreak>.
π VERSION π
Consult $VERSION variable.
π SEE ALSO π
Unicode::LineBreak, Text::Wrap.
π AUTHOR π
Copyright (C) 2009-2012 Hatuka*nezumi - IKEDA Soji
<hatuka(at)nezumi.nu>.
This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself.
π Okay bestie, thatβs the whole page β from User Contributed Perl Documentation, perl v5.42.0, dated 2018-12-29. Stay folded, stay iconic, periodt. π
β¨
π¦ where this page comes from
- opensuse-leap 16.0: perl-Unicode-LineBreak 2019.001-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Unicode-LineBreak 2019.001-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Unicode-LineBreak 2019.001-160000.2.2 Β· Artistic-1.0 OR GPL-1.0-or-later
- opensuse-leap 16.0: perl-Unicode-LineBreak 2019.001-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