in reply to Re: Data::Dumper output
in thread Data::Dumper output

G'day AnomalousMonk,

"Note that details of this behavior changed somewhere between versions 5.8 and 5.30.)"

I suspect that's 5.26.0: "perl5260delta: scalar(%hash) return signature changed". I don't have a pre-5.26 version handy to test that.

However, there's other things probably going on prior to the code shown in the OP:

I'm able to test this much (on 5.32.0):

# The sort of result that was no doubt expected: $ perl -e 'use Data::Dumper; my $hr = bless {a=>1}, "H::R"; my $r = $h +r; print Dumper $r' $VAR1 = bless( { 'a' => 1 }, 'H::R' ); # Reproduce output with stringification and embedded newline: $ perl -e 'use Data::Dumper; my $hr = bless {a=>1}, "H::R"; my $r = "$ +hr\n"; print Dumper $r' $VAR1 = 'H::R=HASH(0x800003b78) '; # No bucket allocation ratio for me; also no strict to advise of probl +em: $ perl -e 'use Data::Dumper; my $hr = bless {a=>1}, "H::R"; my $r = "$ +hr\n"; print Dumper %$r' # Problem advice when strict is used: $ perl -e 'use strict; use Data::Dumper; my $hr = bless {a=>1}, "H::R" +; my $r = "$hr\n"; print Dumper %$r' Can't use string ("H::R=HASH(0x800003b78) ") as a HASH ref while "strict refs" in use at -e line 1.

Bod, address the dot points above: there may be a solution in there. If that solves nothing, provide more code. Also, what Perl version are you using? (I seem to recall you had different versions on your local machine and your hosted server.)

— Ken

Replies are listed 'Best First'.
Re^3: Data::Dumper output
by Bod (Parson) on May 08, 2021 at 11:10 UTC
    address the dot points above: there may be a solution in there

    Yes - sorry guys...I was doing something very silly
    See Re^2: Data::Dumper output

    To answer the version question, I am using v5.16.3. I do have 5.32 locally but this is being written and tested on the webserver as that's where the code will ultimately run and I cannot see the Perl version changing anytime soon.