hi, have problem pointing a hash inside the $selh hash of an object my problem is this:--------------------------------------------------- ==> this is ok ( print the right hash ) --------------------------------------------------- 2008.6.17 10:38:29 pid=10663 P1: (HASH(0x875fffc)) $VAR1 = { 'dummy2' => 33, 'dummy' => 5, 'dtLastRcvMsg' => 1213691909 }; ---------------------------------------------------my %shared_data = ( 'dtLastRcvMsg' => time, 'dummy2' => 33, 'dummy' => 5 ); my $p1 = \%shared_data; mylog( "P1: ($p1) " . Dumper( $p1 ));after I assign the reference of hash to $self->{'shared_data'} and then to $p2 I get a different set of data here wath the Dumper show me: 2008.6.17 10:38:29 pid=10663 P2: (HASH(0x875fffc))$VAR1 = 'HASH(0x875fffc)'; The ref. address seems the same (0x875fffc) but the data inside seems lost What I'm wrong in thsi code ? Any suggestions on that ? Regards and thank for the help .$self->{'shared_data'} = $p1; my $p2 = $self->{'shared_data'}; mylog( "P2: ($p2)" . Dumper( $p2 ));
In reply to FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at by earlati2
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |