my @userids = ( 121,122,123,124,125,126 ); #etc... if ($userid[0] == 121) { do something... } if ($userid[1] == 122) { do somthing else... }