in reply to Request help on optimizing a loop for looking up numbers

Also,

@used_connections[$start .. $end] = (1) x ($end - $start + 1)