From: planetthoughtful Date: 2007-03-15T13:05:14+09:00 Subject: Re: Newbie: if / elseif On Mar 15, 1:12 pm, "Augie De Blieck Jr." wrote: > > if $val =~ /this/i > > puts "this" > > elseif $val =~ /that/i > > puts "that" > > elseif $val =~ /the other/i > > puts "the other" > > end > > Just remember that even when you spell it right, it's going to drop > out of the whole construct just as soon as it fulfills a RegEx. After > it prints "this," it stops looking at any of the other "elsif" > statements. Yes, that was the behaviour I was looking for. I noticed I provided an ambiguous example in that in another construct it would possibly have matched two different conditions. However, in my actual script I am looking for values that are mutually exclusive, so exiting on finding a value is fine. All the best, pt