perl 4.0 patch 8: patch #4, continued
[p5sagit/p5-mst-13.2.git] / x2p / s2p.man
CommitLineData
8d063cd8 1.rn '' }`
9ef589d8 2''' $RCSfile: s2p.man,v $$Revision: 4.0.1.1 $$Date: 91/06/07 12:19:57 $
8d063cd8 3'''
4''' $Log: s2p.man,v $
9ef589d8 5''' Revision 4.0.1.1 91/06/07 12:19:57 lwall
6''' patch4: s2p now handles embedded newlines better and optimizes common idioms
7'''
fe14fcc3 8''' Revision 4.0 91/03/20 01:58:07 lwall
9''' 4.0 baseline.
10'''
a687059c 11''' Revision 3.0 89/10/18 15:35:09 lwall
12''' 3.0 baseline
13'''
378cc40b 14''' Revision 2.0 88/06/05 00:15:59 root
15''' Baseline version 2.0.
8d063cd8 16'''
17'''
18.de Sh
19.br
20.ne 5
21.PP
22\fB\\$1\fR
23.PP
24..
25.de Sp
26.if t .sp .5v
27.if n .sp
28..
29.de Ip
30.br
31.ie \\n.$>=3 .ne \\$3
32.el .ne 3
33.IP "\\$1" \\$2
34..
35'''
36''' Set up \*(-- to give an unbreakable dash;
37''' string Tr holds user defined translation string.
38''' Bell System Logo is used as a dummy character.
39'''
378cc40b 40.tr \(*W-|\(bv\*(Tr
8d063cd8 41.ie n \{\
378cc40b 42.ds -- \(*W-
43.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
44.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
8d063cd8 45.ds L" ""
46.ds R" ""
47.ds L' '
48.ds R' '
49'br\}
50.el\{\
51.ds -- \(em\|
52.tr \*(Tr
53.ds L" ``
54.ds R" ''
55.ds L' `
56.ds R' '
57'br\}
58.TH S2P 1 NEW
59.SH NAME
60s2p - Sed to Perl translator
61.SH SYNOPSIS
62.B s2p [options] filename
63.SH DESCRIPTION
64.I S2p
65takes a sed script specified on the command line (or from standard input)
66and produces a comparable
67.I perl
68script on the standard output.
69.Sh "Options"
70Options include:
71.TP 5
72.B \-D<number>
73sets debugging flags.
74.TP 5
75.B \-n
76specifies that this sed script was always invoked with a sed -n.
77Otherwise a switch parser is prepended to the front of the script.
78.TP 5
79.B \-p
80specifies that this sed script was never invoked with a sed -n.
81Otherwise a switch parser is prepended to the front of the script.
82.Sh "Considerations"
83The perl script produced looks very sed-ish, and there may very well be
84better ways to express what you want to do in perl.
85For instance, s2p does not make any use of the split operator, but you might
86want to.
87.PP
88The perl script you end up with may be either faster or slower than the original
89sed script.
90If you're only interested in speed you'll just have to try it both ways.
91Of course, if you want to do something sed doesn't do, you have no choice.
9ef589d8 92It's often possible to speed up the perl script by various methods, such
93as deleting all references to $\e and chop.
8d063cd8 94.SH ENVIRONMENT
95S2p uses no environment variables.
96.SH AUTHOR
97Larry Wall <lwall@jpl-devvax.Jpl.Nasa.Gov>
98.SH FILES
99.SH SEE ALSO
100perl The perl compiler/interpreter
101.br
102a2p awk to perl translator
103.SH DIAGNOSTICS
104.SH BUGS
105.rn }` ''