From: Brian Candler Date: 2009-02-11T23:58:09+09:00 Subject: Re: Regexp ops: get rid of !=~? Gary Yngve wrote: > "foo" !=~ /bar/ > > does > > "foo".!= (~bar) Actually: "foo" != ~/bar/ > which doesn't produce an error, even though it's > basically > garbage. > Instead it fails silently by returning true (nil or an number are not > strings). The problem here is ~/bar/ This is an ugly Perlism in Ruby which hardly anybody ever uses anyway. Search for Regexp#~ in ri. Personally, I would be very happy to lose this entirely, together with all the other implicit tests and side-effects on $_ (such as is done by Kernel#gets and IO#gets). Or at least have a flag to turn on this behaviour. Regards, Brian. -- Posted via http://www.ruby-forum.com/.