http://www.perlmonks.org?node_id=79443


in reply to Golf: RPN calculator

I did this on Fun-With-Perl (FWP) back in late March.
perl -le '{s!(\S+)\s+(\S+)\s*([-+*/])!"$1$3$2"!ee&&redo}print'


japhy -- Perl and Regex Hacker

Replies are listed 'Best First'.
Re: Re: Golf: RPN calculator
by chipmunk (Parson) on May 11, 2001 at 01:32 UTC
    I think you neglected to read any input... :) perl -ple's,(\S+)\s+(\S+)\s*([-+*/]),"$1$3$2",ee&&redo'
Re: Re: Golf: RPN calculator
by knobunc (Pilgrim) on May 10, 2001 at 21:40 UTC

    FWP

    I would try to explain, but I don't think I can.

    -ben