ASPN ActiveState Programmer Network
  ActiveState
/ Home / Perl / PHP / Python / Tcl / XSLT /
/ Safari / My ASPN /
Cookbooks | Documentation | Mailing Lists | Modules | News Feeds | Products | User Groups | Web Services
SEARCH
advanced | search help

Reference
ActivePerl 5.6
Programs
GET
HEAD
POST
SOAPsh
XMLRPCsh
c2ph
cpan
dprofpp
enc2xs
exetype
find2perl
h2ph
h2xs
libnetcfg
lwp-download
lwp-mirror
lwp-request
lwp-rget
perlbug
perlcc
perlglob
perlivp
piconv
pl2bat
pl2pm
pod2html
pod2latex
pod2man
pod2text
pod2usage
podchecker
podselect
ppm
ppm3
ppm3-bin
psed
pstruct
ptked
ptksh
reloc perl
runperl
s2p
splain
widget
xsubpp

MyASPN >> Reference >> ActivePerl 5.6 >> Programs

 s2p - Sed to Perl translator


NAME

s2p - Sed to Perl translator


SYNOPSIS

s2p [options] filename


DESCRIPTION

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

Options

Options include:

-D<number>
sets debugging flags.

-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.

-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.

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.

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 $\ and chop.


ENVIRONMENT

s2p uses no environment variables.


AUTHOR

Larry Wall <larry@wall.org>


FILES


SEE ALSO

 perl   The perl compiler/interpreter
 a2p    awk to perl translator


DIAGNOSTICS


BUGS

 s2p - Sed to Perl translator


Privacy Policy | Email Opt-out | Feedback | Syndication
© ActiveState 2004 All rights reserved