eval certainly does what you want. I assume that your expression is coming from some sort of user input. If so then you might want to check what it actually contains because eval will just run it as a perl program, so a user could do things that you don't want them to. You might want to do something like checking that the string contains only certain characters:
my @tests = ("1 + 2", "2*3", "(2 + 5) / 3",
"print 'a test', "E = m * c**2", "3**2 + 2");
for my $expr (@tests) {
# Does the string contain any characters that we
# don't want?
if ($expr =~ m![^0-9 + \- / * \( \) \s]!x) {
print "$expr: Invalid\n";
} else {
print "$expr = ", eval $expr, "\n";
}
}