in reply to Re^3: Adjusting variable context when working with JSON data?
in thread Adjusting variable context when workign with JSON data?

I thought that you "\" to de-reference, or maybe that's just for hashes? But in any case I think you're right, I need to write some more Perl to get used to this. I've only started to pick it up out of curiosity, and so far I've only written a few things here and there to get a taste of the basics. Thanks for the help!
  • Comment on Re^4: Adjusting variable context when working with JSON data?

Replies are listed 'Best First'.
Re^5: Adjusting variable context when working with JSON data?
by hippo (Archbishop) on Dec 08, 2024 at 11:32 UTC

    Preceding with a backslash creates a reference to the operand. De-referencing is the opposite of this. Do have a read of the intro to references tutorial, perlreftut and perlref for getting started with references.


    🦛

      Oh, I see. I got it completely backwards. For some reason I thought that `$` was used only for scalar values. Will read more on this, thanks again!
        For some reason I thought that `$` was used only for scalar values.

        Well, yes. A reference is a scalar variable. It contains one value: The reference (in the old days we might have called it the "address") to something else.

        The nature of that "something else" is irrelevant to the typing of the reference -- it is a scalar.