princepawn has asked for the wisdom of the Perl Monks concerning the following question:

I was taking a Sunday stroll through the test suite of Data::Denter, the new alternative integrator of Data::Dumper and Storable functionality, when I stopped dead in my tracks at the following lines of code:
my $a = \\\\'pizza'; my $b = $$a;

Questions

  • What is the first line doing?
  • What is the second line doing?
  • Replies are listed 'Best First'.
    Re: what does \\\\$scalar actually do?
    by runrig (Abbot) on Sep 28, 2001 at 04:12 UTC
      1) taking a reference to a reference to a reference to a reference of a constant scalar value.
      2) dereferencing the reference (by just one level).
      Though why its doing that, I couldn't begin to say...

      Update: I missed that it was in the test suite, and so I concur with stefp.

        Though why its doing that, I couldn't begin to say...

        Pushing things to their limits is a necessary evil in test suites.

        -- stefp