(!$unique[-1] or $unique[-1] != $_) and push @unique, $_ for @list;