$b{$_} = 1 for grep defined, @a; [download]
In reply to Re^3: from array to hash by friedo in thread from array to hash by jeanluca