Beefy Boxes and Bandwidth Generously Provided by pair Networks
Clear questions and runnable code
get the best and fastest answer
 
PerlMonks  

Bizarre copy of HASH in leave

by vijesh (Novice)
on Sep 17, 2012 at 06:14 UTC ( #993975=perlquestion: print w/replies, xml ) Need Help??
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.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: perlquestion [id://993975]
Approved by Ratazong
help
Chatterbox?
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others rifling through the Monastery: (5)
As of 2016-12-04 19:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    On a regular basis, I'm most likely to spy upon:













    Results (69 votes). Check out past polls.