From: Sebastian Hungerecker Date: 2008-05-21T16:20:37+09:00 Subject: Re: Local Jump Error Adam Shelly wrote: > You probably want Find.find{|val|val==src} Nope. The block passed to find is not a filter. Find takes an argument as well as a block and it executes the block for every file it finds. Find always returns nil. So you can't call each on the return value of find and using it as the default value for inject makes no sense (as it's the same as inject(nil). Find.find(src1).each do |file| can be replaced with Find.find(src1) do |file| The inject could be replaced with: src1 = [] Find.find(src) do |file| src1 << file unless $file_exception[i].any? do |x| /#{x}/i =~ File.basename(file) end end or: require 'enumerator' src1 = Find.enum_for(:find, src).reject do |file| $file_exception[i].any? do |x| /#{x}/i =~ File.basename(file) end end # (both untested) HTH, Sebastian -- Jabber: sepp2k@jabber.org ICQ: 205544826