I'm not sure how to solve your problem, but = is the assignment operater. You are telling Perl that $answer should be the same as $question. == is the "equal to" operater. Also, your code calls eval but then does nothing with it. You should have $foo = eval {$answer=$question}; print $foo;. BTW, you only need one ; in the second line.