From: Martin Weber Date: 2003-08-09T09:17:10+09:00 Subject: Re: =~ obsolete? On Sat, Aug 09, 2003 at 09:06:59AM +0900, Hal E. Fulton wrote: > ----- Original Message ----- > From: "Hugh Sasse Staff Elec Eng" > To: "ruby-talk ML" > Sent: Friday, August 08, 2003 7:02 PM > Subject: Re: =~ obsolete? > > > > On Sat, 9 Aug 2003, Dave Brown wrote: > > > > > In article , > > > meinrad.recheis wrote: > > [...] > > > : ruby/lib/ruby/1.8/yaml.rb:28: warning: string =~ string will be > obsolete; > > > : use explicit regexp > > > : > > > : why?? > > > > > > It's string =~ string which is being obsoleted. If you need to > > > > That's "why the error message?". What about "Why will it be > > obsolete?"? > > Can't answer that... > > Why do you need or want string-string as opposed > to string-regex? Not a flame, just a question. > Dunno, maybe because your (mmv, too) principle of least surprise (yes yes I'm not argueing based on it, just offering a view!) told you that finding a substring in a string doesn't need regexes which smell like being awfully slower than plain string searches and the hope that string =~ string is something like string[string] At least that's why I'd try to use it (if not someone recently pointed out string[string] (again!))... -Martin