From: Greg Millam Date: 2002-12-18T17:12:08+09:00 Subject: Re: Regex#=== with non-string argument On Wed, 18 Dec 2002, Joel VanderWerf wrote: > x = 1 > > case x > when 5; puts "5" > when 42; puts "42" > when /abc/; puts "matches /abc/" > when "xyz"; puts "xyz" > end x = 1 puts case when x == 5; "5" when x == 42; "42" when /abc/ =~ x.to_s; "matches /abc/" when "xyz" == x.to_s; "xyz" else "none" end case without a statement matches any expression that evaluates to a non-false, non-nil argument Hope that's what you want - Greg. -- Greg Millam walker at deafcode.com