The Perl output from Data::Dumper doesn't seem to maintain the modifiability of
$rw_var = \do{ my $funky = "thing"}

See the error at the end:

$ perl -MData::Dumper -de1 DB<1> $Data::Dumper::Purity=1; DB<2> $d = \do { my $a = 'blah blah' }; DB<3> x $d 0 SCALAR(0x830501c) -> 'blah blah' DB<4> s/b/B/g for $$d; DB<5> x $d 0 SCALAR(0x830501c) -> 'Blah Blah' DB<6> p Dumper $d $VAR1 = \'Blah Blah'; DB<7> x eval Dumper $d 0 SCALAR(0x839c84c) -> 'Blah Blah' DB<8> s/B/X/g for (${eval Dumper $d}); Modification of a read-only value attempted at (eval 11)[/usr/share/pe +rl/5.6.1/perl5db.pl:1521] line 2.
Brad

PS. I hit this modifying treemap code.
Are there other things like treemap around?
That is, code to do Structure Shy Traversal.


In reply to Data::Dumper + \"constant" problems by bsb

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.