my @points; @points[1 .. 96] = (undef) x 96; for (@grid) { /^(\d{1,2})$/ and $points[$1] = 1; ... }