[comp.lang.perl] sed / awk -> perl

rahardj@ccu.umanitoba.ca (B. Rahardjo) (02/07/90)

I'm new in 'perl' so I want to see what it can do by
translating some of my sed and awk scripts into perl.
The man page says there are translators for sed-> perl, and awk->perl.
So ... where can I get it ?

Budi
-- 
Budi Rahardjo        | rahardj@ccu.UManitoba.CA
Electrical Eng.      | rahardj@ccm.UManitoba.CA
U. of Manitoba       | rahard@ee.UManitoba.CA
Winnipeg, Manitoba, Canada - R3T 2N2

lwall@jpl-devvax.JPL.NASA.GOV (Larry Wall) (02/08/90)

In article <1990Feb6.160320.24006@ccu.umanitoba.ca> rahardj@ccu.UManitoba.CA (B. Rahardjo) writes:
: I'm new in 'perl' so I want to see what it can do by
: translating some of my sed and awk scripts into perl.
: The man page says there are translators for sed-> perl, and awk->perl.
: So ... where can I get it ?

They're called s2p and a2p, and they come with perl.  s2p is in fact a perl
script.

Don't expect these translators to produce totally idiomatic perl code, but
they do okay for showing you what the direct equivalents are.  It's generally
possible to take the translated code and shrink it by half, and make it
much more readable in the process.

Larry

jand@kuling.UUCP (Jan Dj{rv) (02/11/90)

In article <1990Feb6.160320.24006@ccu.umanitoba.ca> rahardj@ccu.UManitoba.CA (B. Rahardjo) writes:
>I'm new in 'perl' so I want to see what it can do by
>translating some of my sed and awk scripts into perl.
>The man page says there are translators for sed-> perl, and awk->perl.
>So ... where can I get it ?
>
The awk/sed to perl (a2p/s2p) translators are included in the perl
distribution. There is a subdirectory x2p where the source ought to be.
When you do 'Make install' a2p and s2p installs themselves into the same
directory as perl. So you probably have them already!

	Jan D.