http://www.perlmonks.org?node_id=1019807


in reply to Re: Alias of hash-values?
in thread Alias of hash-values?

> The thing that surprises me though is that trying to increment the hash keys doesn't die like this one:

Yeah, that was an implicit question.

So anything which is an lvalue in Perl can be aliased in foreach or @_ ?

Cheers Rolf

Replies are listed 'Best First'.
Re^3: Alias of hash-values?
by LanX (Saint) on Feb 20, 2013 at 22:36 UTC
    > So anything which is an lvalue in Perl can be aliased in foreach or @_ ?

    yep, seems to be the case!

    $a=41; sub tst :lvalue { $a } $_++ for tst(); print tst(); # prints 42

    Cheers Rolf