Dear Zaxo,
One last thing here. I'm really sorry for not being precise earlier. I was just trying to pose the problem as simple as possible.
The element of the array in my actual production code
comes with white space like this:
my $HoA = {
'1,2,flintstones' => [ "fred-1 foo-2", "barney-1 bar-2" ],
'2,3,jetsons' => [ "george-1 foo-2", "jane-1 bar-2"],
};
The key of the new hash is identified correctly, the problem is only in the values.
Is there a way I can modify your code? In particular, so that it takes the element of the array as "one" entity regardless the white-space?
So that it doesn't return:
$VAR1 = [
{
'1,2,flintstones' => undef,
'2,3,jetsons' => undef
},
{
'1,2,flintstones' => 'jane-1',
'2,3,jetsons' => 'foo-2'
},
{
'1,2,flintstones' => undef,
'2,3,jetsons' => 'bar}'
},
{
'1,2,flintstones' => 'barney-1',
'2,3,jetsons' => 'foo-2'
},
{
'1,2,flintstones' => undef,
'2,3,jetsons' => 'bar-2}'
}
];
But simply:
my $AoH = [
{
'1,2,flinstones' => "fred-1 foo-2",
'2,3,jetsons' => "george-1 foo-2"
},
{
'1,2,flinstones' => "fred-1 foo-2",
'2,3,jetsons' => "jane-1 bar-2"
},
{
'1,2,flinstones' => "barney-1 bar-2",
'2,3,jetsons' => "george-1 foo-2"
},
{
'1,2,flinstones' => "barney-1 bar-2",
'2,3,jetsons' => "jane-1 bar-2"
},
];
I tried to modify your code by changing the type of separator. But doesn't work either. Hope to hear from you again.
---
neversaint and everlastingly indebted.......
|