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

hi experts, I use v5.8.8 built for i386-freebsd-64int for perl and perl5db.pl version 1.28 for perl debugger. I am trying to push values of hash %pdi like following. Script bumped out with "Bizarre copy of HASH in leave" only when working with perl debugger.

@{%{$pp->{FEATURES}{$rtag}}}{keys %$pdi} = (values %$pdi); DB<4> x %$pdi 0 'CONFIG' 1 HASH(0x1126a154) 'SET' => ARRAY(0x10ef7f64) 0 'command 0' 1 'command 1' 2 'ROLE' 3 HASH(0x10ef7598) 'pe' => '' DB<5>

is it something no-copyable in perl? works in perl but not in perl debugger.. any help is very much appreciated.. -thanks, Vij

Replies are listed 'Best First'.
Re: Bizarre copy of HASH in leave
by Anonymous Monk on Sep 17, 2012 at 07:23 UTC

    that code is broken , it uses symbolic references

    you probably meant

    #!/usr/bin/perl -- use strict; use warnings; my $rtag = 'WHAT'; my $pp = { FEATURES => { WHAT => {} } }; my $pdi = { 1,1,2,2,3,3 }; @{ $pp->{'FEATURES'}{$rtag} } { keys(%$pdi) } = values(%$pdi); use Data::Dump; dd $pp; dd $pdi; __END__ { FEATURES => { WHAT => { 1 => 1, 2 => 2, 3 => 3 } } } { 1 => 1, 2 => 2, 3 => 3 }

    and 5.8.8 is very old

      Thank you very much. This works.