Perl best practices

Paul Lussier p.lussier at comcast.net
Fri Sep 14 10:27:53 EDT 2007


Lloyd Kvam <python at venix.com> writes:

> On Thu, 2007-09-13 at 23:58 -0400, Paul Lussier wrote:
>> For all those just tuning in, Ben and I are in violent and vocal
>> agreement with each other, and at this point are merely quibbling over
>> semantics :) 
>
> As an old Python guy who knows just enough Perl to get it wrong, this
> has been educational (and even fun).

I'm glad you enjoyed it!  That's why I wrote it.  I feel that perl has
a bad reputation for being "ugly".  I believe it's a myth.  One can
write ugly code in any language.  Python went so far as to put white
space restrictions place to "enforce" clean code.  While that may work
to some extent, I've seen ugly python code.

I, by no means, claim my way is the best or only way.  I don't even
claim what I posted will work completely correctly.  I was merely
trying to demonstrate that there are better ways to write any code
such that it is both elegant and pleasing to look at as well as
maintain and extend.

I would love to see other's interpretations of Ben's code, in any language.

How would you accomplish the same in awk, python, ruby, java, C, etc.?

-- 
Seeya,
Paul


More information about the gnhlug-discuss mailing list