my @arr = 1..20 ; my $num = 4; my %h ; @h{@arr} = (undef) x @arr; exists $h{$num} and print qq(Yes, $num exists inside \@arr)