# does what you think: print Math::Light::Expression->new("2*3")->val(); # force the statement delimiter to be ';'. # otherwise it's optional, and whitespaces # delimit expressions my $m = Math::Light::Expression->new({force_semicolon => 1}); $m->parse("a = 2; a^(a+b)")->val({ b => 3}); # arguments to val() overwrite variables in statements: $m->parse("a=1; a*2")->val({ a => -1 }); # result: -2