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

Re: [FWP] Poor reverse polish calculator



On Sat, Mar 24, 2001 at 10:11:08AM -0500, Jeff Pinyan wrote:
> 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

perl -ple'1while s!(\S+)\s+(\S+)\s*([-+*/])!"$1$3$2"!ee'


Abigail

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