[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [FWP] Poor reverse polish calculator



Jeff Pinyan <jeffp@crusoe.net> writes:

> On Mar 24, Jeff Pinyan said:
> >  1 while s!(\S+)\s+(\S+)\s*([-+*/])!"$1 $3 $2"!ee;print
> >which is 54.
> Kick me for introducing a bit of readability into that.
>   1 while s!(\S+)\s+(\S+)\s*([-+*/])!"$1$3$2"!ee;print
> 52.

In that case, why don't you use `1while', and remove the `;print' in
favour of -p?  The original message says you're using -l, but doesn't
work with -n.  Doing this gets the program down to 48 characters.

jason
-- 
4.  A SIMIAN should respond to a TYPE or FASTER request with an
ACCEPT code, especially if there are deadlines.  The only other
allowed responses are REFUSE, ASLEEP, GONE, NORESPONSE, or DEAD.

==== Want to unsubscribe from Fun With Perl?  Well, if you insist...
==== Send email to <fwp-request@technofile.org> with message _body_
====   unsubscribe