how to access the mid element in an array in perl?