* Philippe 'BooK' Bruhat ([EMAIL PROTECTED]) wrote: > Hi, > > I just discovered this, and do not know if it's commonly used in golf > (it's been a long time since I last played): if you only need a single > hash in your script, you can use the symbol table itself. > > Compare the classic "remove duplicate lines" one-liner > > perl -ne'$s{$_}++||print' file > > with > > perl -ne'$$_++||print' file
Whoo, nice :-) I'll add it to my notes, thanks :-) > Three characters in one shot! > > -- > Philippe "BooK" Bruhat > > The learned man makes a mistake but once... but the truly stupid keep > practicing until they get it right. > (Moral from Groo The Wanderer #75 (Epic)) > _______________________________________________ > Cog-book mailing list > [EMAIL PROTECTED] > http://perl-hackers.net/mailman/listinfo/cog-book -- Jose Alves de Castro <[EMAIL PROTECTED]> http://jose-castro.org/