This is a easy way to swap 2 ore more variables in a short and easy way in Perl.In this solution you don’t need a third variable as store.
1 2 3 4 5 |
my $a=37; my $b=55; print "a:$a b:$b n"; ($a,$b) = ($b,$a); print "a:$a b:$b n"; |
And as result we get this:
1 2 |
a:37 b:55 a:55 b:37 |
continuously i used to read smaller posts that also clear their motive, and that is certainly
also happening using this post that i am reading now.