From: Kristof Bastiaensen Date: 2004-04-20T09:19:14+09:00 Subject: Re: add elment on the first index of an array On Sun, 18 Apr 2004 22:21:42 +0200, 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('/') > $a_foo = $a_foo.reverse > $a_foo << 'something' > $a_foo = $a_foo.reverse > > Is there a shorter way to do this? > > greetings > Dirk Einecke $a_foo = $bar.split('/').unshift('something')