On Wed, 27 Oct 2010 19:15:13 +0900, Maurizio Cirilli <mauricirl / gmail.com> wrote: > OK, so looks like there is no way with Ruby to extract > single subarrays from md-arrays with unknown dimensions. > > Thanks all for help. > > -- Maurizio It almost certainly can. I think you just need to rephrase your question so people can see what exactly you want to do. Here is an irb session showing you one way of doing what I think you want to do: >> ss = [[1,2,3],[4,5,6],[7,8,9]] => [[1, 2, 3], [4, 5, 6], [7, 8, 9]] >> main_scope = binding() => #<Binding:0x1011c2828> >> ss.each_with_index{|x,i| eval("v#{i} = x.clone",main_scope) } => [[1, 2, 3], [4, 5, 6], [7, 8, 9]] >> v1 => [4, 5, 6] >> v0 => [1, 2, 3] >> v2 => [7, 8, 9] It's almost certainly not the 'right' way to do what you really want though. -- Alex Gutteridge