my %a = ( 60622 => 1, 60516 => 1, 60201 => 1, ); ... if ($a{$id}) { print OUTPUT_A "$fn, $ln and $id"; } elsif ...