That's why I prefer
$soln[-1] ne $val and push @soln, $val; [download]
In reply to Re^4: reduce like iterators by tybalt89 in thread reduce like iterators by LanX