in reply to HoH, HoA, or something else?
I believe any of these approaches could do what you want.
One point to consider is whether the order of your input data is important. Your example data indicates that it could be sorted but that may not be the case with 'production' data. In this case arrays (which preserve the order) may be better than hashes (which do not).
If you want to 'lookup' data or test for existance a hash would have an advantage.
and
Manipulating Arrays of Arrays in Perl
have many examples.
Update
Also, how would you treat duplicate data? Would each sender appear only once? With, perhaps, a count? This would also steer towards a hash.
|
|---|