Infix to RPN

Score: 210.77 (pass)

Next submission on a different horse. Promise!

#!perl -pl
s/\s//g;%p=qw|* 2 / 2 + 1 - 1|;/\d/?push@_,$_:/\(/?push@@,$_:/\)/?do{push@_,$*while'('ne($*=pop@@)}:do{push@_,pop@@while$p{$@[-1]}>=$p{$_};push@@,$_}for/(?<=[\d)])[*\/+-]|-?\d+|./g;@_=(@_,reverse@@);$_="@_"

Score: 216.79 (pass)

dead horse, I know. At least I'm ahead of /-\ ;)

#!perl -pl
%p=qw|* 2 / 2 + 1 - 1|;s/\s//g;/\d/?push@_,$_:/\(/?push@@,$_:/\)/?do{push@_,$*while@@&&'('ne($*=pop@@)}:do{push@_,pop@@while$p{$@[-1]}>=$p{$_};push@@,$_}for/(?<=[\d)])[*\/+-]|-?\d+|./g;push@_,pop@@while@@;$_="@_"

Score: 224.79 (pass)

As usual, start with the brute force approach.

#!perl -pl
%p=qw|* 2 / 2 + 1 - 1|;s/\s//g;map{/\d/?push@_,$_:/\(/?push@@,$_:/\)/?do{push@_,$*while@@&&'('ne($*=pop@@)}:do{push@_,pop@@while$p{$@[-1]}>=$p{$_};push@@,$_}}m:\b[*/+-]|(?<=\))[*/+-]|-?\d+|.:g;push@_,pop@@while@@;$_="@_"