Cool/useful short examples of Perl?
lesleyb at herlug.org.uk
Tue May 31 01:59:13 BST 2011
On Mon, May 30, 2011 at 07:46:08PM -0400, Uri Guttman wrote:
> >>>>> "NC" == Nicholas Clark <nick at ccl4.org> writes:
> NC> You've stated that you *don't* expect newbies to know how to read
> NC> that line. Leo is currently looking for things that newbies could
> NC> be expected to read.
> then you will get one liners that don't do much. you can't have it both
> ways. either they are useful or they are so simple that newbies can read
> them. using modules isn't a way around that as they shouldn't use one
> without understanding it. so my way is to show how useful a small amount
> of perl can be. get them intrigued and wanting to learn how to do
> that. i haven't seen anything else posted here that is even close to
> useful and cool and newbie level yet. but everyone can jump on
> mine. wow.
I suspect the important thing here is TMTOWTDI .
To be absolutely honest I couldn't come up with a one-liner like the one
you suggested. However it was interesting to read it.
I won't pretend I learned how to write good one-liners from it but maybe
by reading and working through more of the same I could improve.
But I am not a Perl newbie. And I do agree about the maintenance issue.
But a Perl newbie today might have to maintain such code tomorrow.
Perhaps the concept that Leon is working on could be extended to more
intermediate levels as well?
More information about the london.pm