in reply to Golf and Golf

My first thought is to use the for modifier, which doesn't require parens:

$_{$_}++ or push @_, $_ for @T;

But then I realized that a push in a loop is a grep/map:

@_ = grep { !$_{$_}++ } @T;

    -- Chip Salzenberg, Free-Floating Agent of Chaos

Replies are listed 'Best First'.
Re: Re: Golf and Golf
by BrowserUk (Patriarch) on Apr 25, 2003 at 18:18 UTC

    ++@_{@T}, @_ = keys %_;

      I wasn't particularly playing golf with that snippet, but letting it fit the haiku. I'd like to see some other "golf patterns" besides this ever-popular uniq remake.

      --
      [ e d @ h a l l e y . c c ]