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