Help for this page

Select Code to Download


  1. or download this
        my $temp = $_[1];
        $_[1] = $_[0];
        $_[0] = $temp;
    
  2. or download this
        @_[0, 1] = @_[1, 0]
    
  3. or download this
    $ perl -wE '@_ = 0 .. 3; say "@_"; @_[0, 1] = @_[1, 0]; say "@_"'
    0 1 2 3
    1 0 2 3