in reply to Simple CLI calculator based on Perl's eval()

reisinge respect for daring one more step into Lazyness. And sharing your code.

Here's my Lazyness with a big help from Math::Symbolic and friends:

perl -MMath::Symbolic=parse_from_string -MMath::Symbolic::Compiler=com +pile_to_sub -e ' die "no!" unless @ARGV==1 and defined($e=$ARGV[0]) and not $e=~/^\s*$/ and defined($t=Math::Symbolic::parse_from_string($e)) and ($s) = Math::Symbolic::Compiler->compile_to_sub($t) and $s and ref($s)eq"CODE" and defined($r=$s->()) ; print "$r\n"; ' 'sin(log(2,2))'

P.S. I still don't know how to use constants (like PI) into symbolic expressions. Anyone?

bw, bliako