Is there a better (shorter) way to do the $y=o;$x=o; $x$1$y part? You have to do it in that order or else division and subtraction give the wrong result, but it seems like that could be condensed further.
#!/usr/bin/perl -w sub p{push@s,shift}sub o{pop@s}for$n(@ARGV){if($n=~/(\D)/){$y=o;$x=o;p +(eval"$x$1$y")}else{p$n}}print o
---
A fair fight is a sign of poor planning.
In reply to Golf: RPN calculator by Sprad
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |