in reply to Re^2: Use of freed value
in thread Use of freed value

> I think you're referring to the oddities of

Yes

> so the explanations are indeed related. But that's just the precondition for the problem, not the answer itself.

Well I tend to avoid such side effects because of this experience.

I don't necessarily need to know why I suffer after crossing the red line.

Update

And it's a pretty good guess inside the 15 min window you left us before answering it yourself. ;)

Cheers Rolf
(addicted to the Perl Programming Language :)
Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

Replies are listed 'Best First'.
Re^4: Use of freed value
by ikegami (Patriarch) on Jun 27, 2019 at 11:48 UTC

    Well I tend to avoid such side effects because of this experience.

    hum? We use the side effects of putting the actual scalars on the stack all the time (e.g. $x = 3;). I presume you mean you avoid using writing to the scalar twice in the same statement, and avoid writing to the same scalar twice in the same statement.

    The thing is, @a, @a=() doesn't do that, at least not any more than splice(@a) or shift(@a) do, and I'm pretty sure you don't avoid those.

      > I'm pretty sure you don't avoid those.

      I rarely chain statements having side effects with the coma operator.

      Only exception are one liners.

      Cheers Rolf
      (addicted to the Perl Programming Language :)
      Wikisyntax for the Monastery FootballPerl is like chess, only without the dice

        In that case, to put it in your words, the purposes of my posts was to explain (to those interested) why one suffers after crossing the red line in this situation.

        That said, the reason one suffers in this situation is completely different than the reason one suffers with call(++$x, ++$x).