From: Mohammad Khan Date: 2004-05-27T00:52:48+09:00 Subject: Re: delete_if woes I think, I got you wrong. a = [ 'at', 'atx', 'xatx', 'xat', 'xyz' ] rgx = Regexp.new(/at/) a.delete_if { | x | (rgx =~ x).to_i > 0 } #after this, my 'a' is # ["at", "atx", "xyz"] # which is logical and I dont see any odd. # what is #{attr} from your end? ----- Original Message ----- From: "Zach Dennis" To: "ruby-talk ML" Sent: Wednesday, May 26, 2004 10:14 AM Subject: delete_if woes > I am having trouble with my delete_if block. > > prop_array.delete_if{ |p| > (p=~/#{attr}/).to_i > 0; } > > and i have tried the longer version > > prop_array.delete_if{ |p| > m = (p=~/#{attr}/).to_i > m > 0; } > > and i have tried > > prop_array.delete_if{ |p| > (p=~/#{attr}/) != nil } > > It deletes every element, even when m == 0 or m == nil. Any ideas? Thanks, > > Zach > --- > Outgoing mail is certified Virus Free. > Checked by AVG anti-virus system (http://www.grisoft.com). > Version: 6.0.684 / Virus Database: 446 - Release Date: 5/13/2004 > > >