Debian Codegraph @

upstream/opensuse-tumbleweed/man3/Text::Tabs.3pm

raw
1 .\" -*- mode: troff; coding: utf-8 -*-
2 .\" Automatically generated by Pod::Man v6.0.2 (Pod::Simple 3.45)
3 .\"
4 .\" Standard preamble:
5 .\" ========================================================================
6 .de Sp \" Vertical space (when we can't use .PP)
7 .if t .sp .5v
8 .if n .sp
9 ..
10 .de Vb \" Begin verbatim text
11 .ft CW
12 .nf
13 .ne \\$1
14 ..
15 .de Ve \" End verbatim text
16 .ft R
17 .fi
18 ..
19 .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>.
20 .ie n \{\
21 . ds C` ""
22 . ds C' ""
23 'br\}
24 .el\{\
25 . ds C`
26 . ds C'
27 'br\}
28 .\"
29 .\" Escape single quotes in literal strings from groff's Unicode transform.
30 .ie \n(.g .ds Aq \(aq
31 .el .ds Aq '
32 .\"
33 .\" If the F register is >0, we'll generate index entries on stderr for
34 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
35 .\" entries marked with X<> in POD. Of course, you'll have to process the
36 .\" output yourself in some meaningful fashion.
37 .\"
38 .\" Avoid warning from groff about undefined register 'F'.
39 .de IX
40 ..
41 .nr rF 0
42 .if \n(.g .if rF .nr rF 1
43 .if (\n(rF:(\n(.g==0)) \{\
44 . if \nF \{\
45 . de IX
46 . tm Index:\\$1\t\\n%\t"\\$2"
47 ..
48 . if !\nF==2 \{\
49 . nr % 0
50 . nr F 2
51 . \}
52 . \}
53 .\}
54 .rr rF
55 .\"
56 .\" Required to disable full justification in groff 1.23.0.
57 .if n .ds AD l
58 .\" ========================================================================
59 .\"
60 .IX Title "Text::Tabs 3pm"
61 .TH Text::Tabs 3pm 2026-03-09 "perl v5.42.1" "Perl Programmers Reference Guide"
62 .\" For nroff, turn off justification. Always turn off hyphenation; it makes
63 .\" way too many mistakes in technical documents.
64 .if n .ad l
65 .nh
66 .SH NAME
67 Text::Tabs \- expand and unexpand tabs like unix expand(1) and unexpand(1)
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& use Text::Tabs;
72 \&
73 \& $tabstop = 4; # default = 8
74 \& @lines_without_tabs = expand(@lines_with_tabs);
75 \& @lines_with_tabs = unexpand(@lines_without_tabs);
76 .Ve
77 .SH DESCRIPTION
78 .IX Header "DESCRIPTION"
79 Text::Tabs does most of what the unix utilities \fBexpand\fR\|(1) and \fBunexpand\fR\|(1)
80 do. Given a line with tabs in it, \f(CW\*(C`expand\*(C'\fR replaces those tabs with
81 the appropriate number of spaces. Given a line with or without tabs in
82 it, \f(CW\*(C`unexpand\*(C'\fR adds tabs when it can save bytes by doing so,
83 like the \f(CW\*(C`unexpand \-a\*(C'\fR command.
84 .PP
85 Unlike the old unix utilities, this module correctly accounts for
86 any Unicode combining characters (such as diacriticals) that may occur
87 in each line for both expansion and unexpansion. These are overstrike
88 characters that do not increment the logical position. Make sure
89 you have the appropriate Unicode settings enabled.
90 .SH EXPORTS
91 .IX Header "EXPORTS"
92 The following are exported:
93 .IP expand 4
94 .IX Item "expand"
95 .PD 0
96 .IP unexpand 4
97 .IX Item "unexpand"
98 .ie n .IP $tabstop 4
99 .el .IP \f(CW$tabstop\fR 4
100 .IX Item "$tabstop"
101 .PD
102 The \f(CW$tabstop\fR variable controls how many column positions apart each
103 tabstop is. The default is 8.
104 .Sp
105 Please note that \f(CWlocal($tabstop)\fR doesn\*(Aqt do the right thing and if you want
106 to use \f(CW\*(C`local\*(C'\fR to override \f(CW$tabstop\fR, you need to use
107 \&\f(CWlocal($Text::Tabs::tabstop)\fR.
108 .SH EXAMPLE
109 .IX Header "EXAMPLE"
110 .Vb 3
111 \& #!perl
112 \& # unexpand \-a
113 \& use Text::Tabs;
114 \&
115 \& while (<>) {
116 \& print unexpand $_;
117 \& }
118 .Ve
119 .PP
120 Instead of the shell\*(Aqs \f(CW\*(C`expand\*(C'\fR command, use:
121 .PP
122 .Vb 1
123 \& perl \-MText::Tabs \-n \-e \*(Aqprint expand $_\*(Aq
124 .Ve
125 .PP
126 Instead of the shell\*(Aqs \f(CW\*(C`unexpand \-a\*(C'\fR command, use:
127 .PP
128 .Vb 1
129 \& perl \-MText::Tabs \-n \-e \*(Aqprint unexpand $_\*(Aq
130 .Ve
131 .SH BUGS
132 .IX Header "BUGS"
133 Text::Tabs handles only tabs (\f(CW"\et"\fR) and combining characters (\f(CW\*(C`/\epM/\*(C'\fR). It doesn\*(Aqt
134 count backwards for backspaces (\f(CW"\et"\fR), omit other non\-printing control characters (\f(CW\*(C`/\epC/\*(C'\fR),
135 or otherwise deal with any other zero\-, half\-, and full\-width characters.
136 .SH LICENSE
137 .IX Header "LICENSE"
138 Copyright (C) 1996\-2002,2005,2006 David Muir Sharnoff.
139 Copyright (C) 2005 Aristotle Pagaltzis
140 Copyright (C) 2012\-2013 Google, Inc.
141 This module may be modified, used, copied, and redistributed at your own risk.
142 Although allowed by the preceding license, please do not publicly
143 redistribute modified versions of this code with the name "Text::Tabs"
144 unless it passes the unmodified Text::Tabs test suite.