Case three and four is wrong. Naming changing nothing about this. What you can do, is register _specific_ references as having a name, _and_ name the root objects. However this is not feasable unless you know what these references are ahead of time. For a different and IMO clearer example of this problem try the following:
Dumper version: 2.102 ---------------------------------------- Before: $VAR1 = [ \\do{my $o}, do{my $o} ]; ${${$VAR1->[0]}} = $VAR1->[0]; $VAR1->[1] = ${$VAR1->[0]}; After: $VAR1 = [ \\do{my $o}, do{my $o} ]; ${${$VAR1->[0]}} = $VAR1->[0]; $VAR1->[1] = ${$VAR1->[0]}; $dump and $after are the same as each other Before: $VAR1 = [ \\do{my $o}, do{my $o} ]; ${${$VAR1->[0]}} = $VAR1->[0]; $VAR1->[1] = ${$VAR1->[0]}; After: $VAR1 = [ \\do{my $o}, do{my $o} ]; ${${$VAR1->[0]}} = $VAR1->[0]; $VAR1->[1] = ${$VAR1->[0]}; $dump and $after are the same as each other Before: $VAR1 = [ \\do{my $o}, do{my $o} ]; ${${$VAR1->[0]}} = $VAR1->[0]; $VAR1->[1] = ${$VAR1->[0]}; After: $VAR1 = [ \\do{my $o}, do{my $o} ]; ${${$VAR1->[0]}} = $VAR1->[0]; $VAR1->[1] = ${$VAR1->[0]}; $dump and $after are the same as each other ---------------------------------------- $VAR1 = [ \'Test', 'Test' ]; $VAR1 = [ \'Test', ${$VAR1->[0]} ]; $VAR1 = [ \'Test', ${$VAR1->[0]} ];
First they ignore you, then they laugh at you, then they fight you, then you win.
-- Gandhi
• Update:
*blush* the before and after was wrong. Still my point is clear. These data structures are different, but dump the same.
In reply to Re: Re: Data::Dumper scalar refs undef
by demerphq
in thread Data::Dumper scalar refs undef
by bsb
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |