From: Martin DeMello Date: 2004-04-20T22:09:08+09:00 Subject: Re: add elment on the first index of an array Dirk Einecke wrote: > Hi. > > I have an array. Now I will add a element on the first index. I do this > like this: > > $a_foo = Array.new > $a_foo = $bar.split('/') Apart from anything else, note that this is unnecessary in Ruby - objects are typed, but variables are not. So $a_foo = Array.new just creates an empty array, and discards it in the next line - $bar.split creates an entirely new array, to which $a_foo now points. martin