From: knohr Date: 2007-06-14T06:30:26+09:00 Subject: question: referencing a variable with a variable I come from a perl background. I have gotten in the habit of using references to variables instead of specifically calling said variable/ class/whatever. Basically, I am wondering how I would translate the following into ruby. example 1: sub my_sub { $choice = shift; $choices="this|that|foo|bar"; if ( $choice =~ m/($choices)/ ) {&$choice} else {die "some witty msg"} } example 2: $this = 'var_name'; $var_name = 'i want this to print'; print $$var_name . "\n"; thanks