-----Original Message-----
From: Jaffer Shaik [mailto:[EMAIL PROTECTED]
Sent: Fri 7/23/2004 11:10 AM
To: Perl
Cc:
Subject: swapping in perl
Dear Friends,
I want to swap 2 variables without using a tempoarary variable.
I know the below logic
a=a+b
b=a-b
a=a-b
Other than this logic, is thery any other way in perl.
Regards,
Jaffer.
Just do
($a,$b) = ($b,$a)
It ll be swapped.
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>