$hash{$_} = 1 foreach @{foo()};