From: Michael Neumann Date: 2001-06-30T02:47:40+09:00 Subject: [ruby-talk:17073] Re: Warnings with Oracle, DBI 0.5 Daniel Berger wrote: > Hi all, > > I ran a fairly simple query and got several warnings. The query > returned the proper results successfully, but I'm curious as to why > I'm getting these warnings. Any ideas? Sorry to get back at you so late. > /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:478: warning: `&' > interpreted as argument prefix > /usr/local/lib/ruby/site_ruby/1.6/dbi/dbi.rb:644: warning: `&' > interpreted as argument prefix This warning is thrown for example for: p = Proc.new {p "hallo"} [1,2].each &p and you don't put braces around &p. I fixed this in 0.0.6 > /usr/local/lib/ruby/site_ruby/1.6/dbi/utils.rb:134: warning: useless > use of [] in void context This perhaps misguides the user, because [] is a method call, so it do make sense in a void context! For example aProc[params] is equivalent to aProc.call(params). But I changed this, too. > /usr/local/lib/ruby/site_ruby/1.6/dbi/sql.rb:42: warning: gsub! (...) > interpreted as method call "hallo".gsub!(...) # no warning "hallo".gsub! (...) # warning > /usr/local/lib/ruby/site_ruby/1.6/dbi/sql.rb:44: warning: sub! (...) > interpreted as method call same as gsub! > /usr/local/lib/ruby/site_ruby/1.6/DBD/Oracle/Oracle.rb:33: warning: > discarding old to_i I redefined to_i, because I don't want to depend on the oracle.rb module, only oracle.so. This makes sense, if we would merge someday the C sources into DBI. As you see, that are no errors, nothing is wrong, just hints. But thanks anyway, I think it's better to raise as less as possible warnings to see the "real" warnings. Regards, Michael -- Michael Neumann merlin.zwo InfoDesign GmbH http://www.merlin-zwo.de