From: Ferdous ara Date: 2012-10-02T21:47:38+09:00 Subject: need help to fix syntax problem for cgi Hi bellow is the script. I think its failing at if #{f['name']} =~/asw1-v2r7c9-bry/ brydc << #{f['name']} end but dont understand where is the problem , i just get Internal Server Error if i enable this line brydc << #{f['name']} I am quite new and i am from php background.. and in php it was easy to troubleshoot .. #!/usr/bin/ruby require 'cgi' require 'mysql' cgi = CGI.new m = Mysql.new("localhost","root","","report") r = m.query("select device.name as name, hardware.name as model device.hardware=hardware.id") brydc=Array.new r.each_hash do |f| if #{f['name']} =~/asw1-v2r7c9-bry/ brydc << #{f['name']} end end puts cgi.header puts " Per DataCenter

Switch Per DataCenter

" brydc.each do |f| puts "" puts "" puts "" end puts "
#{f['name']}
" thanks for your help. -- Posted via http://www.ruby-forum.com/.