in reply to
(Golf) Reversing RPN Notation

The tricky part for me was coming up with a good way to determine when parentheses should be used. I decided to save the operator priority of each term, so I could compare it to the priority of the next operator. I'm interested to see how other people tackle this problem.

**118 characters** in the body of the sub:

`%o = ('+' => 1,
'-' => 1,
'*' => 2,
'/' => 2,
);
sub rpn2ltr {
for$i(@r=@_){if($p=$o{$i}){$_=$p>$_->[0]?"($_->[1])":$_->[1]
for$r=pop,$l=pop}push@_,[$p||9,$p?"$l $i $r":$i]}$_[-1][1]
}
`