sub uniq { my %h; # Keep track of things seen. grep { # 4: Return items seen only once. not $h{$_}++ # 2: Item is not (yet) be seen. # 3: ++ would then say item was seen. } @_; # 1: For each input... }