in reply to RE: Re: List processing performance
in thread List processing performance

Golf, eh? @words = sort grep !$seen{+lc}++, @words; The + keeps lc from being interpreted as a hash key, and lc operates on $_ by default.

Update: Of course, this works if your data set is all lowercase. Moral of the story, don't go for the birdie unless you're sure it's what you want.

Replies are listed 'Best First'.
RE: (chromatic) RE: RE: Re: List processing performance
by btrott (Parson) on Jul 12, 2000 at 07:08 UTC
    Yes, but it doesn't work properly, because you're not actually changing $_. And if you don't change $_, then the words don't get lower-cased, and your sort is off (because it'll sort upper-case before lower-case).