$h{$_} = () for (500, 501, 502, 531, 532); while () { chomp; print "$_\n" if exists $h{$_}; } __DATA__ 500 501 502 503 504 508 522 531 532 505