--- Rick Klement <[EMAIL PROTECTED]> wrote:
> > The only solution is to use them more...
>
> Or study the post-mortems from previous games. I always recommend
> golfers
> study Eugene's rev.pl from Andrew's Santa Challenge: "print the
> lines from
> an input file in reverse order". Almost everyone found the simple,
> short,
> clean, and straightforward solution:
>
> print reverse<>
>
> but Eugene saved two strokes with:
>
> -p $\=$_.$\}{
Where in the man-pages does it document ``}{'' ? I've never
encountered it before?
> Studying this solution gives insight not only to how $\ works, but
> how -p
> is structured, how to avoid using the word "print", and even what
> exactly
> is printed by a bare "print" without an argument.
>
> Also, the winning cantor.pl from TPR03 used $\ instead of $_ to
> save
> tie-breaker points.
>
> >
> > Cheers guys, I'm most impressed.
> >
> > I shall be coming back for more punishment in the next one :-)
>
> You did extremely well for a first golf entry, congratulations!
I've been faffing around with making code shorter for a long time,
mainly C (google-groups for 'Hannum Carmody tweaks' to see one of the
more interesting shortenings of C code I've had a hand in), but a
little perl too. So I'm not really a true beginner. I'm also fairly
mathematical, so Hamming codes were more to my taste. I'd probably
not have broken the 3-digit mark for the vowels/words TPR one we've
just had.
However, one thing that I've seen, and admired, is the fact that even
the people who are capable of doing 160-character entries will submit
early 400-character entries with no shame. I need to swallow my
pride, and just do what I can - and if it gets shorter, then that's
great, but if it doesn't at least I took part.
I think I could make use of a 'team' environment, as I do have a lot
of catching up to do. Any Finns in the Helsinki area fancy hacking
perl in a smokey pub drinking Koff?
FatPhil
=====
--
"One cannot delete the Web browser from KDE without
losing the ability to manage files on the user's own
hard disk." - Prof. Stuart E Madnick, MIT.
So called "expert" witness for Microsoft. 2002/05/02
__________________________________________________
Do You Yahoo!?
Yahoo! - Official partner of 2002 FIFA World Cup
http://fifaworldcup.yahoo.com