Your skill will accomplish what the force of many cannot |
|
PerlMonks |
Re: Array of Hashes to Hash of arrays for SQL::Abstractby BillKSmith (Monsignor) |
on Mar 18, 2020 at 17:48 UTC ( [id://11114440]=note: print w/replies, xml ) | Need Help?? |
You have not specified exactly what is required for your 'missing keys' test case. There is a very subtle difference between $data_hash->{c}->[2] = undef and $data)hash->{c}->[2] does not exist. I assumed that it should be undef. This requires setting the length of the arrays. The following test passes. Try commenting out the statement with '# Set length'. Observe how the test fails.
Of course, if you require c => [11, 12] then the "set length" statement must be omitted.
Bill
In Section
Seekers of Perl Wisdom
|
|