Initial commit of OpenSPARC T2 design and verification files.
[OpenSPARC-T2-DV] / tools / perl-5.8.0 / man / man1 / splain.1
CommitLineData
86530b38
AT
1.\" Automatically generated by Pod::Man v1.34, Pod::Parser v1.13
2.\"
3.\" Standard preamble:
4.\" ========================================================================
5.de Sh \" Subsection heading
6.br
7.if t .Sp
8.ne 5
9.PP
10\fB\\$1\fR
11.PP
12..
13.de Sp \" Vertical space (when we can't use .PP)
14.if t .sp .5v
15.if n .sp
16..
17.de Vb \" Begin verbatim text
18.ft CW
19.nf
20.ne \\$1
21..
22.de Ve \" End verbatim text
23.ft R
24.fi
25..
26.\" Set up some character translations and predefined strings. \*(-- will
27.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
28.\" double quote, and \*(R" will give a right double quote. | will give a
29.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used to
30.\" do unbreakable dashes and therefore won't be available. \*(C` and \*(C'
31.\" expand to `' in nroff, nothing in troff, for use with C<>.
32.tr \(*W-|\(bv\*(Tr
33.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
34.ie n \{\
35. ds -- \(*W-
36. ds PI pi
37. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
38. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
39. ds L" ""
40. ds R" ""
41. ds C` ""
42. ds C' ""
43'br\}
44.el\{\
45. ds -- \|\(em\|
46. ds PI \(*p
47. ds L" ``
48. ds R" ''
49'br\}
50.\"
51.\" If the F register is turned on, we'll generate index entries on stderr for
52.\" titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and index
53.\" entries marked with X<> in POD. Of course, you'll have to process the
54.\" output yourself in some meaningful fashion.
55.if \nF \{\
56. de IX
57. tm Index:\\$1\t\\n%\t"\\$2"
58..
59. nr % 0
60. rr F
61.\}
62.\"
63.\" For nroff, turn off justification. Always turn off hyphenation; it makes
64.\" way too many mistakes in technical documents.
65.hy 0
66.if n .na
67.\"
68.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69.\" Fear. Run. Save yourself. No user-serviceable parts.
70. \" fudge factors for nroff and troff
71.if n \{\
72. ds #H 0
73. ds #V .8m
74. ds #F .3m
75. ds #[ \f1
76. ds #] \fP
77.\}
78.if t \{\
79. ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80. ds #V .6m
81. ds #F 0
82. ds #[ \&
83. ds #] \&
84.\}
85. \" simple accents for nroff and troff
86.if n \{\
87. ds ' \&
88. ds ` \&
89. ds ^ \&
90. ds , \&
91. ds ~ ~
92. ds /
93.\}
94.if t \{\
95. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101.\}
102. \" troff and (daisy-wheel) nroff accents
103.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104.ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110.ds ae a\h'-(\w'a'u*4/10)'e
111.ds Ae A\h'-(\w'A'u*4/10)'E
112. \" corrections for vroff
113.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115. \" for low resolution devices (crt and lpr)
116.if \n(.H>23 .if \n(.V>19 \
117\{\
118. ds : e
119. ds 8 ss
120. ds o a
121. ds d- d\h'-1'\(ga
122. ds D- D\h'-1'\(hy
123. ds th \o'bp'
124. ds Th \o'LP'
125. ds ae ae
126. ds Ae AE
127.\}
128.rm #[ #] #H #V #F C
129.\" ========================================================================
130.\"
131.IX Title "SPLAIN 1"
132.TH SPLAIN 1 "2002-08-28" "perl v5.8.0" "Perl Programmers Reference Guide"
133.SH "NAME"
134diagnostics \- Perl compiler pragma to force verbose warning diagnostics
135.PP
136splain \- standalone program to do the same thing
137.SH "SYNOPSIS"
138.IX Header "SYNOPSIS"
139As a pragma:
140.PP
141.Vb 2
142\& use diagnostics;
143\& use diagnostics -verbose;
144.Ve
145.PP
146.Vb 2
147\& enable diagnostics;
148\& disable diagnostics;
149.Ve
150.PP
151Aa a program:
152.PP
153.Vb 2
154\& perl program 2>diag.out
155\& splain [-v] [-p] diag.out
156.Ve
157.SH "DESCRIPTION"
158.IX Header "DESCRIPTION"
159.ie n .Sh "The ""diagnostics"" Pragma"
160.el .Sh "The \f(CWdiagnostics\fP Pragma"
161.IX Subsection "The diagnostics Pragma"
162This module extends the terse diagnostics normally emitted by both the
163perl compiler and the perl interpreter, augmenting them with the more
164explicative and endearing descriptions found in perldiag. Like the
165other pragmata, it affects the compilation phase of your program rather
166than merely the execution phase.
167.PP
168To use in your program as a pragma, merely invoke
169.PP
170.Vb 1
171\& use diagnostics;
172.Ve
173.PP
174at the start (or near the start) of your program. (Note
175that this \fIdoes\fR enable perl's \fB\-w\fR flag.) Your whole
176compilation will then be subject(ed :\-) to the enhanced diagnostics.
177These still go out \fB\s-1STDERR\s0\fR.
178.PP
179Due to the interaction between runtime and compiletime issues,
180and because it's probably not a very good idea anyway,
181you may not use \f(CW\*(C`no diagnostics\*(C'\fR to turn them off at compiletime.
182However, you may control their behaviour at runtime using the
183\&\fIdisable()\fR and \fIenable()\fR methods to turn them off and on respectively.
184.PP
185The \fB\-verbose\fR flag first prints out the perldiag introduction before
186any other diagnostics. The \f(CW$diagnostics::PRETTY\fR variable can generate nicer
187escape sequences for pagers.
188.PP
189Warnings dispatched from perl itself (or more accurately, those that match
190descriptions found in perldiag) are only displayed once (no duplicate
191descriptions). User code generated warnings ala \fIwarn()\fR are unaffected,
192allowing duplicate user messages to be displayed.
193.Sh "The \fIsplain\fP Program"
194.IX Subsection "The splain Program"
195While apparently a whole nuther program, \fIsplain\fR is actually nothing
196more than a link to the (executable) \fIdiagnostics.pm\fR module, as well as
197a link to the \fIdiagnostics.pod\fR documentation. The \fB\-v\fR flag is like
198the \f(CW\*(C`use diagnostics \-verbose\*(C'\fR directive.
199The \fB\-p\fR flag is like the
200\&\f(CW$diagnostics::PRETTY\fR variable. Since you're post-processing with
201\&\fIsplain\fR, there's no sense in being able to \fIenable()\fR or \fIdisable()\fR processing.
202.PP
203Output from \fIsplain\fR is directed to \fB\s-1STDOUT\s0\fR, unlike the pragma.
204.SH "EXAMPLES"
205.IX Header "EXAMPLES"
206The following file is certain to trigger a few errors at both
207runtime and compiletime:
208.PP
209.Vb 8
210\& use diagnostics;
211\& print NOWHERE "nothing\en";
212\& print STDERR "\en\etThis message should be unadorned.\en";
213\& warn "\etThis is a user warning";
214\& print "\enDIAGNOSTIC TESTER: Please enter a <CR> here: ";
215\& my $a, $b = scalar <STDIN>;
216\& print "\en";
217\& print $x/$y;
218.Ve
219.PP
220If you prefer to run your program first and look at its problem
221afterwards, do this:
222.PP
223.Vb 2
224\& perl -w test.pl 2>test.out
225\& ./splain < test.out
226.Ve
227.PP
228Note that this is not in general possible in shells of more dubious heritage,
229as the theoretical
230.PP
231.Vb 2
232\& (perl -w test.pl >/dev/tty) >& test.out
233\& ./splain < test.out
234.Ve
235.PP
236Because you just moved the existing \fBstdout\fR to somewhere else.
237.PP
238If you don't want to modify your source code, but still have on-the-fly
239warnings, do this:
240.PP
241.Vb 1
242\& exec 3>&1; perl -w test.pl 2>&1 1>&3 3>&- | splain 1>&2 3>&-
243.Ve
244.PP
245Nifty, eh?
246.PP
247If you want to control warnings on the fly, do something like this.
248Make sure you do the \f(CW\*(C`use\*(C'\fR first, or you won't be able to get
249at the \fIenable()\fR or \fIdisable()\fR methods.
250.PP
251.Vb 4
252\& use diagnostics; # checks entire compilation phase
253\& print "\entime for 1st bogus diags: SQUAWKINGS\en";
254\& print BOGUS1 'nada';
255\& print "done with 1st bogus\en";
256.Ve
257.PP
258.Vb 4
259\& disable diagnostics; # only turns off runtime warnings
260\& print "\entime for 2nd bogus: (squelched)\en";
261\& print BOGUS2 'nada';
262\& print "done with 2nd bogus\en";
263.Ve
264.PP
265.Vb 4
266\& enable diagnostics; # turns back on runtime warnings
267\& print "\entime for 3rd bogus: SQUAWKINGS\en";
268\& print BOGUS3 'nada';
269\& print "done with 3rd bogus\en";
270.Ve
271.PP
272.Vb 4
273\& disable diagnostics;
274\& print "\entime for 4th bogus: (squelched)\en";
275\& print BOGUS4 'nada';
276\& print "done with 4th bogus\en";
277.Ve
278.SH "INTERNALS"
279.IX Header "INTERNALS"
280Diagnostic messages derive from the \fIperldiag.pod\fR file when available at
281runtime. Otherwise, they may be embedded in the file itself when the
282splain package is built. See the \fIMakefile\fR for details.
283.PP
284If an extant \f(CW$SIG\fR{_\|_WARN_\|_} handler is discovered, it will continue
285to be honored, but only after the \fIdiagnostics::splainthis()\fR function
286(the module's \f(CW$SIG\fR{_\|_WARN_\|_} interceptor) has had its way with your
287warnings.
288.PP
289There is a \f(CW$diagnostics::DEBUG\fR variable you may set if you're desperately
290curious what sorts of things are being intercepted.
291.PP
292.Vb 1
293\& BEGIN { $diagnostics::DEBUG = 1 }
294.Ve
295.SH "BUGS"
296.IX Header "BUGS"
297Not being able to say \*(L"no diagnostics\*(R" is annoying, but may not be
298insurmountable.
299.PP
300The \f(CW\*(C`\-pretty\*(C'\fR directive is called too late to affect matters.
301You have to do this instead, and \fIbefore\fR you load the module.
302.PP
303.Vb 1
304\& BEGIN { $diagnostics::PRETTY = 1 }
305.Ve
306.PP
307I could start up faster by delaying compilation until it should be
308needed, but this gets a \*(L"panic: top_level\*(R" when using the pragma form
309in Perl 5.001e.
310.PP
311While it's true that this documentation is somewhat subserious, if you use
312a program named \fIsplain\fR, you should expect a bit of whimsy.
313.SH "AUTHOR"
314.IX Header "AUTHOR"
315Tom Christiansen <\fItchrist@mox.perl.com\fR>, 25 June 1995.