my @result = grep !$temp{$_}++, @list;

凄げーよね、@listをuniqにソートするコードだって。
パールならではだよね。
普通なにしてるかわからんよw