for $PARTS (@PARTS) { if ($PARTS eq $ordnum) { # assuming 'eq' is correct here $found = 1; last; } }