in reply to Re^2: Non-destructive array processing
in thread Non-destructive array processing
But what will simply alias the lexical @array with the dynamical @array. So I don't see what you've achieved by doing this.
One problem with this that you probably didn't foresee is that lexicals are resolved before dynamic variables. Example:
The problem is solved through our() since that creates an aliased lexical:my @foo = 1..4; local *foo = ['a'..'d']; print @foo; # 1234
ihbmy @foo = 1..4; our @foo = 'a'..'d'; print @foo; # abcd
|
---|
In Section
Meditations