[Israel.pm] awk equivalent

Offer Kaye oferk at oren.co.il
Mon Mar 22 22:34:09 PST 2004


>
> Hi,
>
> What is the Perl equivalent of:
>

Haven't you asked this already? Oh well, here's my version:
1. awk '{print $3}' filename
vs.
1. perl -alpe'$_=$F[2]' filename

2. awk -Fc '{print $3}' filename
vs.
2. perl -Fc -alpe'$_=$F[0]' filename

> I know how to get it done in Perl, but my question is about "equivalent"
> code.
>
> Yossi

If you know how to do it, what are you asking? Obviously TIMTOWTDI (duh!),
so how do you define "equivalent" in this context? The "best" way? The most
"awk like" way? What?

----------------------------------
Offer Kaye



More information about the Perl mailing list