From: "David A. Black" Date: 2004-02-16T07:39:27+09:00 Subject: Re: problem with variables Hi -- On Mon, 16 Feb 2004, Dirk Einecke wrote: > Hi. > > I've a problem with variables. > I define a global variable outside a method and then I use this variable > in a method. And thats my problem. I can print the value of the variable > but in the line with the eval() the place holder (#{temp}) is not > replaced and the output is empty. But why. > > Can anybody help me? > > > #!/usr/bin/ruby > > $temp = "Hallo" > > def test() > puts $temp # -> Hallo ... all is okay > test = "#{temp} World" The variable name you want is $temp, not temp. (Assuming you *really* want to use a global variable, which is another matter.... :) David -- David A. Black dblack@wobblini.net