in reply to Re^2: local our $var; What does it do?
in thread local our $var; What does it do?
our @a; local *a = shift;
can be safely rewritten as
\local our @a = shift;
but you'd normally want
\my @a = shift;
since the only reason package variables were used is because lexical variables couldn't be aliased like that.
That means the code should really become
sub sum { \my @a = shift; my $total = 0; $total += $a[ $_ ] for 0 .. $#a; return $total; }
|
|---|