From: Jens Rohde Date: 2001-09-26T05:29:48+09:00 Subject: [ruby-talk:21679] Re: Problems with the mysql-module On Tue, 25 Sep 2001, Michael Neumann wrote: Hi again > export LD_LIBRARY_PATH=/pack/mysql/lib/mysql Well... got the module allright now, but now I'm facing a new problem. Check this piece of source-code: def parseLog sql = "insert into pixlog (srcIP,destIP) values (?,?)" File.open(@logFile,"r") do |logFile| logFile.each_line do |logLine| if (logLine =~ /Dlast message repeated/) if !(@lastLine == "") xTimes = logLine.split[8].to_i for count in 1..xTimes theData = parseString(@lastLine) @dbHandle.do = (sql,theData[2].to_i,theData[4]) end end else theData = parseString(logLine) @lastLine = logLine @dbHandle.do = (sql,theData[2].to_i,theData[4]) end end end end If I comment out the "@dbHandle.do"-stuff everything works ok. If don't I get the following error: ./pixlog.rb:96: parse error ./pixlog.rb:103: parse error ./pixlog.rb:118: class definition in method body ./pixlog.rb:120: nested method definition def initialize(tmpFile, database) ^ ./pixlog.rb:134: nested method definition ./pixlog.rb:154: nested method definition ./pixlog.rb:180: parse error The "def initialize(tmpFile, database)"-part is the constructor from the next class. It seems like I'm missing an "end" somewhere, but I can't figure out where. The full source can be found at http://www.rohde.dk/pixlog.rb. -- Jens Rohde, System Administrator ----------------------------------------------------------------------- Eastfork Object Space (EOS), Margrethepladsen 3, 8000 Aarhus C, Denmark Tel: +45 8732 8787 / Fax: +45 8732 8788