in reply to swapping vars, two ways, 2 results...
Other way:Well, maybe you get different results because the above way is hosed. Hopefully it's just a typo, but you're assigning to $b in both the last two lines, and never assigning to $a. In any event, swapping "perl's way" is better, faster, cheaper, shorter, and preferable in every way. Any questions?my $tmp = $b ; $b = $a ; $b = $tmp ;
jdporter
...porque es dificil estar guapo y blanco.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: swapping vars, two ways, 2 results...
by BrowserUk (Patriarch) on Dec 19, 2002 at 03:02 UTC | |
by jdporter (Paladin) on Dec 19, 2002 at 03:35 UTC | |
by BrowserUk (Patriarch) on Dec 19, 2002 at 04:39 UTC | |
by RMGir (Prior) on Dec 19, 2002 at 19:24 UTC | |
by BrowserUk (Patriarch) on Dec 19, 2002 at 19:41 UTC | |
by Sihal (Pilgrim) on Dec 19, 2002 at 08:41 UTC |