freebsd-nq/gnu/usr.bin/perl/x2p/s2p.1
1994-09-10 06:27:55 +00:00

109 lines
2.5 KiB
Groff

.rn '' }`
''' $RCSfile: s2p.man,v $$Revision: 1.1.1.1 $$Date: 1993/08/23 21:30:10 $
'''
''' $Log: s2p.man,v $
.\" Revision 1.1.1.1 1993/08/23 21:30:10 nate
.\" PERL!
.\"
''' Revision 4.0.1.1 91/06/07 12:19:57 lwall
''' patch4: s2p now handles embedded newlines better and optimizes common idioms
'''
''' Revision 4.0 91/03/20 01:58:07 lwall
''' 4.0 baseline.
'''
''' Revision 3.0 89/10/18 15:35:09 lwall
''' 3.0 baseline
'''
''' Revision 2.0 88/06/05 00:15:59 root
''' Baseline version 2.0.
'''
'''
.de Sh
.br
.ne 5
.PP
\fB\\$1\fR
.PP
..
.de Sp
.if t .sp .5v
.if n .sp
..
.de Ip
.br
.ie \\n.$>=3 .ne \\$3
.el .ne 3
.IP "\\$1" \\$2
..
'''
''' Set up \*(-- to give an unbreakable dash;
''' string Tr holds user defined translation string.
''' Bell System Logo is used as a dummy character.
'''
.tr \(*W-|\(bv\*(Tr
.ie n \{\
.ds -- \(*W-
.if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
.if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch
.ds L" ""
.ds R" ""
.ds L' '
.ds R' '
'br\}
.el\{\
.ds -- \(em\|
.tr \*(Tr
.ds L" ``
.ds R" ''
.ds L' `
.ds R' '
'br\}
.TH S2P 1 NEW
.SH NAME
s2p - Sed to Perl translator
.SH SYNOPSIS
.B s2p [options] filename
.SH DESCRIPTION
.I S2p
takes a sed script specified on the command line (or from standard input)
and produces a comparable
.I perl
script on the standard output.
.Sh "Options"
Options include:
.TP 5
.B \-D<number>
sets debugging flags.
.TP 5
.B \-n
specifies that this sed script was always invoked with a sed -n.
Otherwise a switch parser is prepended to the front of the script.
.TP 5
.B \-p
specifies that this sed script was never invoked with a sed -n.
Otherwise a switch parser is prepended to the front of the script.
.Sh "Considerations"
The perl script produced looks very sed-ish, and there may very well be
better ways to express what you want to do in perl.
For instance, s2p does not make any use of the split operator, but you might
want to.
.PP
The perl script you end up with may be either faster or slower than the original
sed script.
If you're only interested in speed you'll just have to try it both ways.
Of course, if you want to do something sed doesn't do, you have no choice.
It's often possible to speed up the perl script by various methods, such
as deleting all references to $\e and chop.
.SH ENVIRONMENT
S2p uses no environment variables.
.SH AUTHOR
Larry Wall <lwall@jpl-devvax.Jpl.Nasa.Gov>
.SH FILES
.SH SEE ALSO
perl The perl compiler/interpreter
.br
a2p awk to perl translator
.SH DIAGNOSTICS
.SH BUGS
.rn }` ''