Is there a way to set the indice on an array,
i.e.

Instead of:

myarray = [1,2,3,4,5]
myarray[1] =2
myarray[4]=5

myarray[A]=1

I know this can be done using hashes but was not sure with arrays

Stuart