in reply to Re: local our $var; What does it do? (\local our: [perl #125436])
in thread local our $var; What does it do?
However, the usefulness of '\local our' in this scenario eludes me. @::data does not get back its previous values.
In that case, as a feature, it still needs work, because it doesn't produce the same results as the existing syntax its intended to simplify:
our @data = 'fred'; sub x{ our @data; local *data = shift; print $data[ $_ ] for 0 .. $#data; };; my @junk = reverse 1 .. 10; x( \@junk ); print ">>@data<<<";; 10 9 8 7 6 5 4 3 2 1 >>fred<<<
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^3: local our $var; What does it do?
by kcott (Archbishop) on Jun 18, 2015 at 15:37 UTC |