http://qs321.pair.com?node_id=11131809


in reply to Referencing the locals

Hi. You'll get a better understanding of this by taking a look on Variables and Scoping tutorials, and I definitely recommend this article too.

P.S.: Later on, I noticed scoping rules are not the key point here. Yet the reading I mentioned helps.

return on_success() or die;

Replies are listed 'Best First'.
Re^2: Referencing the locals
by haukex (Archbishop) on Apr 28, 2021 at 19:21 UTC
    You'll get a better understanding of this by taking a look on Variables and Scoping tutorials, and I definitely recommend this article too.

    Note that this isn't an issue of scoping, and none of those links discuss symbolic references.

    $ perl -le '$x=2; my $x=4; print ${x}, ${"x"}' 42

      My bad. It's just that I saw the term local variables associated to lexical variables, and ended up focusing on that. I'm sorry.

      return on_success() or die;

        No worries, and thanks for editing your node! In the context of the question, the difference between lexical and package variables is relevant, which those tutorials do cover.