Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re^3: merge with multiple row with same keyby davido (Cardinal) |
on Nov 27, 2014 at 03:34 UTC ( [id://1108524]=note: print w/replies, xml ) | Need Help?? |
That cannot be the output from Data::Dumper, because it lacks commas between some of the elements. When you post imprecise samples and claim that they're the output of something that generates precise, and syntactically correct data structures, we're unable to trust your problem description, much less know how to fill in the missing parts. Your expected result is also impossible, unless we should be interpreting it as simple text. From a Perl data structure point of view, 'abc,def' => { 'item1,item2,,item4 }, is nonsensical; the curly braces mean "anonymous hash", and the leading single quote isn't balanced by any closing single quote. Given the ambiguity introduced by leaving quotes unbalanced, we also can't determine which of the commas should be interpreted as literal text, or as operators. Also, since hash elements have no predictable or useful order, it would be helpful to specify how the "item1" and so on elements should be ordered (assuming you really intend for them to be array elements). With those flaws in the question making it impossible to precisely know what is being asked, it is also impossible to give an answer that is guaranteed to precisely match your needs. But this is an attempt at getting close:
The output that produces is this:
Dave
In Section
Seekers of Perl Wisdom
|
|