From: ara.t.howard@... Date: 2006-12-06T07:21:13+09:00 Subject: Re: Can one use line addresses...to select a portion of file On Wed, 6 Dec 2006, David Vallner wrote: >> There is a lesser-known (and usually frowned upon?) feature in Ruby that >> treats Range notation differently in a "boolean context." >> >> IO.foreach(file) do |line| # use this rather that loading the whole file >> if line =~ /__McDonalds__/ .. line =~ /__Happy_Meal__/ >> do_stuff_with line >> end >> end >> > > So -this- is what that does? > > Does this do that? yes. > Does anyone know what that notation does? it's a boolean toggle. well doccumented in pickaxe and every perl book out there - if not somewhat esoteric. cheers. -a -- if you want others to be happy, practice compassion. if you want to be happy, practice compassion. -- the dalai lama