s2p

NAME

s2p - Sed to Perl translator

SYNOPSIS

s2p [-np] [-Dnumber] filename

DESCRIPTION

The s2p(1) utility takes a sed(1) script specified on the command line (or from standard input) and produces a comparable perl(1) script on the standard output.

Options include:

-Dnumber
Sets debugging flags.
-n
Specifies that this sed script was always invoked with the sed option -n. Otherwise, a switch parser is prepended to the front of the script.
-p
Specifies that this sed script was never invoked with the sed option -n. Otherwise, a switch parser is prepended to the front of the script.

Considerations

The perl(1) script produced looks very much like sed; there might be better ways to express what you want to do in perl. For instance, even though s2p does not use the split operator, you might want to do so.

The perl(1) script produced might be either faster or slower than the original sed(1) script. If you are interested only in speed, try both scripts to determine which is faster. If you want to do something sed does not do, however, and you must therefore use perl, there are several things you can do to speed up the perl script, such as deleting all references to $\ and chop.

ENVIRONMENT VARIABLES

The s2p(1) utility uses no environment variables.

SEE ALSO

perl(1) (the perl(1) compiler/interpreter)

a2p(1) (the awk(1) to perl(1) translator)