in reply to Simple CLI calculator based on Perl's eval()
Nice. Being familiar with forth and thus reverse polnish notation, I use Math::RPN with ~/bin/rpn containing
#!/usr/bin/perl use Math::RPN;$|=1; 1 while($_="@ARGV"||<>)&&!((@s=rpn@s,split)&&$s[-1]=~/^q/i||print("@s +")&&@ARGV&&print($/))
for ad-hoc calculations.
|
|---|