From: Niko Schwarz Date: 2001-12-30T07:57:29+09:00 Subject: [ruby-talk:29662] Re: Copying an Array Matthew Diephouse wrote: > What's the best way to copy an array? Well, you could do this: copy = orig.clone if you have a 2d-array, try this: copy = orig.map { |el| el.clone } and if you need a deep copy (clone is only shallow), then you will need to marshal and unmarshal. theres also some subtle difference between dup and clone, but i have to admit that im too lazy to seek for that one right now.. regards, nick -- The older I grow the more I distrust the familiar doctrine that age brings wisdom. -- H. L. Mencken