Help for this page

Select Code to Download


  1. or download this
    my $a = 10;
    
    ...
    sub change {
        $_[0]++;
    }
    
  2. or download this
    my $a = 10;
    
    ...
        my $param = shift;
        $param++;
    }
    
  3. or download this
    # contrived example: there usually isn't a good reason
    # to have references to scalars.
    ...
        my $param = shift;
        ${$param}++;
    }
    
  4. or download this
    my $a = 10;
    my $b = \$a;
    ...
    sub change {
        $_[0] = \$c;
    }