Implementing Swap [was Re: [] Report on Yesterday's Meeting]

Shlomi Fish shlomif at
Sun Jun 5 10:04:50 PDT 2005

In the meeting, Shlomo used a swap($a, $b) function. Some people claimed it 
could not be implemented in Perl, or only by using prototypes. But in fact it 


use strict;
use warnings;

sub swap
    my ($v1, $v2) = (@_);
    $_[0] = $v2;
    $_[1] = $v1;    

my $i = 500;
my $j = 32;

print "\$i=$i ; \$j=$j\n";

my $array = [0,1,2,3,4,5];
print '$array = ' . join(", ", @$array) . "\n";

Try it!

Another thing that MiGo claimed was that Internet Explorer did not support 
accesskey="". However, it can do just that. For example at the page:

If you press Alt+N and then enter, you'll be redirected to the next page.


	Shlomi Fish

Shlomi Fish      shlomif at

Tcl is LISP on drugs. Using strings instead of S-expressions for closures
is Evil with one of those gigantic E's you can find at the beginning of 

More information about the Perl mailing list