[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



Or:

    ($p,$q) = ($q,$p);

perhaps clearer. One of my favorite Perl-only idioms...

At 10:16 PM 6/10/99 -0500, Tushar Samant wrote:
>
>    $q^=$p^=$q^=$p
>
>(probably well-known; if not, try it)
>
>
>==== 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
> 


==== 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