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

Re: [Fun With Perl] How to swap $p and $q without $tmp



On Thu, Jun 10, 1999 at 10:58:45PM -0500, Tushar Samant wrote:
> On Thu, 10 Jun 1999, Michael G Schwern wrote:
> > On Thu, Jun 10, 1999 at 10:16:45PM -0500, Tushar Samant wrote:
> > > 
> > >     $q^=$p^=$q^=$p
> > > 
> > > (probably well-known; if not, try it)
> > 
> > ($p,$q) = ($q,$p);
> 
> That's highly obfuscated. Are you sure you want it in maintainable code?

<looking around nervously>That's a joke... right?

-- 

Michael G Schwern                                           schwern@pobox.com
                    http://www.pobox.com/~schwern
     /(?:(?:(1)[.-]?)?\(?(\d{3})\)?[.-]?)?(\d{3})[.-]?(\d{4})(x\d+)?/i

==== Want to unsubscribe from this list? (Don't you love us anymore?)
==== Well, if you insist... Send mail with body "unsubscribe" to
==== fwp-request@technofile.org