From: "Weirich, James" Date: 2003-09-12T07:37:35+09:00 Subject: Re: print out a variable's name and value? Ferenc Engard [mailto:ferenc@engard.hu] writes: > I want a comfortable debug function to which I can pass a > variable, and it writes out the variable's name and value. Try this: def dbg(&block) varname = block.call.to_s puts "DBG: #{varname} = #{eval(varname,block)}" end x = 10 dbg{:x} # IMPORTANT! Notice curly braces. -- -- Jim Weirich / Compuware -- FWP Capture Services -- Phone: 859-386-8855