From: jackster the jackle Date: 2008-10-04T10:01:24+09:00 Subject: Re: Iterate through array and delete if match > Or Array#reject! > > deleting while iterating with each is undefined behavior. It's like > sawing off the tree branch you are sitting on. hehehe...I know what you mean! Tim's solution worked, I used: @acl_all_array.each do |range| if range[/access-list/] @acl_range.push(range) end end @acl_all_array.delete_if { |x| x[/access-list/] } Thanks for all the help guys...I am going to read up on Array#reject! to see how that might help me. john -- Posted via http://www.ruby-forum.com/.