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

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




> Easy. Just right to left. Equivalent multiline version:
> 
>  $q ^= $p;
>  $p ^= $q;
>  $q ^= $p;
>
> BTW, why does this work with strings of different length?
> Deep Perl magic?
>
> (puzzled)

This, I believe, is the true power of Perl over C
(and, WTROSALW) other lesser langs...

-Sneex- :]
_________________________________________________________________________
Bill Jones  | Data Security Specialist | http://www.fccj.org/cgi/mail?dss
FCCJ  |  501 W State St  |  Jacksonville, FL 32202  |  1 (904) 632-3089

$_="Jacksonville Perl Mongers";while(/([Jacksonville Perl Mongers])/g){
print join(" ",map{defined $_ ? $_ : ""}$`,$&,$',$+),"\n";}

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