in reply to Re^2: check if a number is in a list
in thread check if a number is in a list

Is the map really needed? What about:
my %array; @array{@array}=();