in reply to Re^2: FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at
in thread FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at

It still works for me? Assuming that the relevant part of the program (going by the comments) is these 3 statements:

my %shared_data = ( 'dtLastRcvMsg' => time, 'dummy2' => 33, 'dummy' => 5 ); my ( $p1, $p2 ); # 1° test : OK $p1 = \%shared_data; $self->mylog( "P1: ($p1) " . Dumper( $p1 )); # 2° test : OK $p2 = $p1; $self->mylog( "P2: ($p2)" . Dumper( $p2 )); # 3° test : NOT-OK $self->{'shared_data'} = $p1; $p2 = $self->{'shared_data'}; $self->mylog( "P2: ($p2)" . Dumper( $p2 ));

This is the output I get from them:

c:\test\691728>..\junk.pl ..Non posso aprire il file /var/log/www/test1.dat (No such file or dir +ectory) print() on closed filehandle F at c:\test\junk.pl line 105. [2008.6.17 13:39:5] pid=2032 P1: (HASH(0x1e74f40)) $VAR1 = { 'dummy2' => 33, 'dummy' => 5, 'dtLastRcvMsg' => 1213706345 }; ..Non posso aprire il file /var/log/www/test1.dat (No such file or dir +ectory) print() on closed filehandle F at c:\test\junk.pl line 105. [2008.6.17 13:39:5] pid=2032 P2: (HASH(0x1e74f40))$VAR1 = { 'dummy2' => 33, 'dummy' => 5, 'dtLastRcvMsg' => 1213706345 }; ..Non posso aprire il file /var/log/www/test1.dat (No such file or dir +ectory) print() on closed filehandle F at c:\test\junk.pl line 105. [2008.6.17 13:39:5] pid=2032 P2: (HASH(0x1e74f40))$VAR1 = { 'dummy2' => 33, 'dummy' => 5, 'dtLastRcvMsg' => 1213706345 };

I had to disable a few things because I didn't have the relevant modules, but nothing that would affect those 3 outputs. For reference, here's the exact code I ran to get the above output:

I still suspect that you are simplifying the code for demonstration purposes and failing to demonstrate the problem.

Your not by any chance trying to share references between processes are you? Because that doesn't work!


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
"Too many [] have been sedated by an oppressive environment of political correctness and risk aversion."
  • Comment on Re^3: FATAL ERROR: Can't use string ("HASH(0x875fffc)") as a HASH ref while "strict refs" in use at
  • Select or Download Code