Debian Codegraph @

upstream/mageia-cauldron/man3pm/less.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 "less 3pm"
61 .TH less 3pm 2023-12-22 "perl v5.42.0" "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 less \- perl pragma to request less of something
68 .SH SYNOPSIS
69 .IX Header "SYNOPSIS"
70 .Vb 1
71 \& use less \*(AqCPU\*(Aq;
72 .Ve
73 .SH DESCRIPTION
74 .IX Header "DESCRIPTION"
75 This is a user\-pragma. If you\*(Aqre very lucky some code you\*(Aqre using
76 will know that you asked for less CPU usage or ram or fat or... we
77 just can\*(Aqt know. Consult your documentation on everything you\*(Aqre
78 currently using.
79 .PP
80 For general suggestions, try requesting \f(CW\*(C`CPU\*(C'\fR or \f(CW\*(C`memory\*(C'\fR.
81 .PP
82 .Vb 3
83 \& use less \*(Aqmemory\*(Aq;
84 \& use less \*(AqCPU\*(Aq;
85 \& use less \*(Aqfat\*(Aq;
86 .Ve
87 .PP
88 If you ask for nothing in particular, you\*(Aqll be asking for \f(CWless
89 \&\*(Aqplease\*(Aq\fR.
90 .PP
91 .Vb 1
92 \& use less \*(Aqplease\*(Aq;
93 .Ve
94 .SH "FOR MODULE AUTHORS"
95 .IX Header "FOR MODULE AUTHORS"
96 less has been in the core as a "joke" module for ages now and it
97 hasn\*(Aqt had any real way to communicating any information to
98 anything. Thanks to Nicholas Clark we have user pragmas (see
99 perlpragma) and now \f(CW\*(C`less\*(C'\fR can do something.
100 .PP
101 You can probably expect your users to be able to guess that they can
102 request less CPU or memory or just "less" overall.
103 .PP
104 If the user didn\*(Aqt specify anything, it\*(Aqs interpreted as having used
105 the \f(CW\*(C`please\*(C'\fR tag. It\*(Aqs up to you to make this useful.
106 .PP
107 .Vb 3
108 \& # equivalent
109 \& use less;
110 \& use less \*(Aqplease\*(Aq;
111 .Ve
112 .ie n .SS """BOOLEAN = less\->of( FEATURE )"""
113 .el .SS "\f(CWBOOLEAN = less\->of( FEATURE )\fP"
114 .IX Subsection "BOOLEAN = less->of( FEATURE )"
115 The class method \f(CW\*(C`less\->of( NAME )\*(C'\fR returns a boolean to tell you
116 whether your user requested less of something.
117 .PP
118 .Vb 4
119 \& if ( less\->of( \*(AqCPU\*(Aq ) ) {
120 \& ...
121 \& }
122 \& elsif ( less\->of( \*(Aqmemory\*(Aq ) ) {
123 \&
124 \& }
125 .Ve
126 .ie n .SS """FEATURES = less\->of()"""
127 .el .SS "\f(CWFEATURES = less\->of()\fP"
128 .IX Subsection "FEATURES = less->of()"
129 If you don\*(Aqt ask for any feature, you get the list of features that
130 the user requested you to be nice to. This has the nice side effect
131 that if you don\*(Aqt respect anything in particular then you can just ask
132 for it and use it like a boolean.
133 .PP
134 .Vb 6
135 \& if ( less\->of ) {
136 \& ...
137 \& }
138 \& else {
139 \& ...
140 \& }
141 .Ve
142 .SH CAVEATS
143 .IX Header "CAVEATS"
144 .IP "This probably does nothing." 4
145 .IX Item "This probably does nothing."
146 .PD 0
147 .IP "This works only on 5.10+" 4
148 .IX Item "This works only on 5.10+"
149 .PD
150 At least it\*(Aqs backwards compatible in not doing much.