S
Sébastien Cottalorda
Hi all,
I'm trying to add Hash::Flatten functionality to the IPC::Shareable
module.
In IPC::Shareable, I've that function:
sub _freeze {
my $s = shift;
my $water = shift;
....
my $ice = freeze $water;
....
$s->shmwrite($ice);
}
I'm trying to add Hash::Flatten like this:
sub _freeze {
my $s = shift;
my $water = shift;
....
$water = flatten($water, { HashDelimiter => '->', ArrayDelimiter
=> '=>', });
my $ice = freeze $water;
....
$s->shmwrite($ice);
}
unfortunately, sometimes, i obtains:
"Not a SCALAR reference at /home/workspace/panneau/modules/IPC/
Shareable.pm line 717."
and the module crashes.
When I print $water just before flatten(...), I get REF(0x8fdc2d4)
instead of HASH(0x...)
With the Data:
umper module, I obtains:
$water = \{
'key' => 'value',
'another_key => {
'key1' => 'value1',
....
},
}
How can I transform $water from REF(0x....) to HASH(0x....)
Thanks in advance for any kind of help.
Sebastien
I'm trying to add Hash::Flatten functionality to the IPC::Shareable
module.
In IPC::Shareable, I've that function:
sub _freeze {
my $s = shift;
my $water = shift;
....
my $ice = freeze $water;
....
$s->shmwrite($ice);
}
I'm trying to add Hash::Flatten like this:
sub _freeze {
my $s = shift;
my $water = shift;
....
$water = flatten($water, { HashDelimiter => '->', ArrayDelimiter
=> '=>', });
my $ice = freeze $water;
....
$s->shmwrite($ice);
}
unfortunately, sometimes, i obtains:
"Not a SCALAR reference at /home/workspace/panneau/modules/IPC/
Shareable.pm line 717."
and the module crashes.
When I print $water just before flatten(...), I get REF(0x8fdc2d4)
instead of HASH(0x...)
With the Data:
$water = \{
'key' => 'value',
'another_key => {
'key1' => 'value1',
....
},
}
How can I transform $water from REF(0x....) to HASH(0x....)
Thanks in advance for any kind of help.
Sebastien