- or download this
sub func {
# Any changes to $_ will affect the caller's var.
local *_ = \$_[0];
...
}
- or download this
sub func {
my ($s) = $_[0]; # Safe.
local *_ = \$s;
...
}
- or download this
sub func {
# Any changes to $_ will affect the caller's var.
...
...
}
}
- or download this
sub func {
for (my $s = $_[0]) { # Safe.
...
}
}