From: Alexander Schofield Date: 2002-01-24T14:15:49+09:00 Subject: Re: Array.last Weirdness Array#last= doesn't exist in 1.6 , I don't think it has been added since. class Array def last= (obj) self[length-1] = obj end end Will give you the functionality you want (but I think you would need to do array.last += ' world'). Just as an aside, this is a method which could save a lot of typing in many situations when you are building up an array, it saves you having to type arr[arr.length-1]= all over the place. Shouldn't it be added? Alexander Schofield Jesse Jones wrote: > > I'd expect the following code: > > array = ["hello"] > array.last += " world" > puts array > > to print "hello world", but instead I get errors like "undefined method > `last=' for ["hello"]:Array (NameError)". This doesn't seem too good... > > -- Jesse