I'm trying to figure it out today to go a long way. I killed him to death, and none of the examples or my hacking examples did this. It seems to be pretty easy, but I just can't get it. Here is the code:
use strict;
use Data::Dumper;
my $complex_variable = {};
my $MEMORY = "$ENV{HOME}/data/memory-file";
$complex_variable->{ 'key' } = 'value';
$complex_variable->{ 'key1' } = 'value1';
$complex_variable->{ 'key2' } = 'value2';
$complex_variable->{ 'key3' } = 'value3';
print Dumper($complex_variable)."TEST001\n";
open M, ">$MEMORY" or die;
print M Data::Dumper->Dump([$complex_variable], ['$complex_variable']);
close M;
$complex_variable = {};
print Dumper($complex_variable)."TEST002\n";
do $MEMORY;
print Dumper($complex_variable)."TEST003\n";
And here is my conclusion:
$VAR1 = {
'key2' => 'value2',
'key1' => 'value1',
'key3' => 'value3',
'key' => 'value'
};
TEST001
$VAR1 = {};
TEST002
$VAR1 = {};
TEST003
All that I read suggests that the output of TEST003 should look exactly like the result of TEST001, and that is what I am trying to achieve.
What am I missing here? Should I "do" differently or should I be "eval" ing, and if so, how?
Thanks for any help ...
source
share