in reply to Re^3: doubts about Data::Dumper output
in thread doubts about Data::Dumper output

I'm not sure what bug you're talking about

The weird  do{my $o} .... I forgot to realize that $Data::Dumper::Deparse wasn't turned on ... yeah

Replies are listed 'Best First'.
Re^5: doubts about Data::Dumper output
by LanX (Saint) on Oct 07, 2014 at 07:45 UTC
    Not that weird, it returns a lexical scalar variable for the slot.

    But without polluting the namespace with the dummy name $o, cause the scope is limited.

    Cheers Rolf

    (addicted to the Perl Programming Language and ☆☆☆☆ :)

      Not that weird, it returns a lexical scalar variable for the slot. But without polluting the namespace with the dummy name $o, cause the scope is limited.

      Sure its weird to write  do { my $o} when it could write undef or "DUMMY" or "fix" or "V: $VAR1->{a}" or any other string

        > when it could write ... "V: $VAR1->{a}"

        MidLifeXis already explained purity

        > when it could write undef or "DUMMY" or "fix"

        see Scalar::Util readonly to understand the difference between passed literals and variables.

        readonly SCALAR Returns true if SCALAR is readonly. sub foo { readonly($_[0]) } $readonly = foo($bar); # false $readonly = foo(0); # true

        If you think Data::Dumper should be cleverer instead of playing safe, you are free to provide a patch.

        > Sure its weird

        Claiming a "bug" without deeper knowledge seems weird to me.

        Cheers Rolf

        (addicted to the Perl Programming Language and ☆☆☆☆ :)