extract string -- TIMTOWTDI

Paul Lussier p.lussier at comcast.net
Wed Jan 11 10:18:01 EST 2006


William D Ricker <wdr at TheWorld.com> writes:

>> On 1/10/06, Paul Lussier <p.lussier at comcast.net> wrote:
>> > > perl -ne 'split ","; $_ = $_[2]; s/(^")|("$)//g; print if m/univ/;' <
>> > > abc.txt > def.txt
>> > Egads!

[outstanding explanation I didn't have time to write myself removed ]

> None of this is seriously obfuscatory golfing, but if someone wanted to
> say darn the cost of forking new processes off bash, 'awk/cut|grep|sed'
> is easier to read, well, I won't argue that it's easier for him/her
> to read, and they should do it that way -- unless they need to tune
> for performance.

I would, however, offer that if someone were to find
'awk/cut|grep|sed' easier to read, then that person a) wouldn't have
asked this question ;) and b) would certainly benefit from learning
perl for those times when "the cost of forking new processes off bash"
can't be ignored for some reason :) Additionally, perl offers the
benefit of a debugger which can be immensely helpful for even simple
"one liner" tasks.
-- 
Seeya,
Paul



More information about the gnhlug-discuss mailing list