7stud -- wrote:
>>>
>>> a[puts "hello"] = a[puts "world"] = nil
>> 
>> puts returns nil, and you can't index an array with nil.
>> 

How's this:

a = Array(1..6)

a[(puts "hello", 0..a.size/2;0..a.size/2)] = a[(puts "world", 
a.size*2/3..1;a.size*2/3..1)] = nil
p a


-- 
Posted via http://www.ruby-forum.com/.