From: Agent Mulder Date: 2011-08-13T18:17:20+09:00 Subject: How to get the Name of a Variable Hello. When I call a function with an argument, I want to retrieve the NAME of the original argument I passed into the funtion. In the code snippet below, I want the last line of output to be: The NAME of the variable you passed in is: local_var instead of The NAME of the variable you passed in is: WHAT DO I NEED HERE? Thank you! def a_not_so_special_function(a) puts "You are inside a_not_so_special_function().\n" puts "The VALUE of the variable you passed in is: "+a puts "The NAME of the variable you passed in is: "+"WHAT DO I NEED HERE?" end local_var="foo" a_not_so_special_function(local_var) __OUTPUT__ You are inside a_not_so_special_function(). The VALUE of the variable you passed in is: foo The NAME of the variable you passed in is: WHAT DO I NEED HERE? -- Posted via http://www.ruby-forum.com/.