LanX has asked for the wisdom of the Perl Monks concerning the following question:
Hi
could someone please point me to documentation giving insight about hash-values being lvalues which can be aliased?
DB<126> @h{1..5}=(1..5);\%h => { 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5 } DB<127> $_++ for %h DB<128> \%h => { 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6 } DB<129> sub tst { $_++ for @_ } DB<130> @h{1..5}=(1..5);\%h => { 1 => 1, 2 => 2, 3 => 3, 4 => 4, 5 => 5 } DB<131> tst(%h) DB<132> \%h => { 1 => 2, 2 => 3, 3 => 4, 4 => 5, 5 => 6 }
Cheers Rolf
|
---|
Replies are listed 'Best First'. | |
---|---|
Re: Alias of hash-values?
by moritz (Cardinal) on Feb 20, 2013 at 16:22 UTC | |
by Athanasius (Archbishop) on Feb 21, 2013 at 02:21 UTC | |
by LanX (Saint) on Feb 21, 2013 at 02:32 UTC | |
by LanX (Saint) on Feb 20, 2013 at 16:58 UTC | |
by LanX (Saint) on Feb 20, 2013 at 22:36 UTC |
Back to
Seekers of Perl Wisdom