Re: Small golfing trick
[email protected] ((Philippe 'BooK' Bruhat)) Fri, 24 Mar 2006 11:24:33 +0100
| Newsgroups | perl.golf |
|---|---|
| Message-ID | <[email protected]> |
Le vendredi 24 mars 2006 à 09:14, Jasper écrivait: > On 3/23/06, Philippe 'BooK' Bruhat <[email protected]> wrote: > > > perl -ne'$s{$_}++||print' file > > > > with > > > > perl -ne'$$_++||print' file > > > > Three characters in one shot! > > I think MTV used this in the palindrome golf, at least. So it's been > around for a while :) I was pretty sure this wasn't original, but I liked the feeling when I thought "by the way, the symbol table is just a hash!". With the help of :: (or rather '), one can even build up nested data structures, I think... -- Philippe "BooK" Bruhat Your reputation is what you make of it... and what you choose to take with you. (Moral from Groo The Wanderer #48 (Epic))