in reply to Array to Hash

for (@array) { $hash{$_} = 1 } is how I'd do it.