From: Lars Date: 2008-03-07T19:09:55+09:00 Subject: Re: Iterating over a nil value from CSV element On Mar 6, 6:24 pm, Max Russell wrote: > when I'm parsing a csv file, and don't want to use those elements that > return a nil value, what is the easiest way to do so? I've tried: > > if record == nil > next > else If tend to like boolean expressions rather than comparison with 'nil' (or false): next if record.nil? or next unless record The latter will skip when next is either 'nil' or 'false'. If you have multiple fields and want to skip if they all are nil/ false: next unless first or second or third If you want to skip if any of them are nil/false: next unless first and second and third Lars