![]() |
|
Keep It Simple, Stupid | |
PerlMonks |
Re: Clarity in parsing fixed length data.by hv (Parson) |
on Aug 11, 2006 at 10:52 UTC ( #566780=note: print w/replies, xml ) | Need Help?? |
I find unclear the way the two lists are interleaved. In a style similar to that hinted at in GrandFather's comment, I'd tend to write this as list of hashrefs:
At this point you can just as easily construct the list of fieldnames and the unpack string, but it is more self-documenting, and you can easily extend the structures later if you need to start adding validation callbacks and the like. Hope this helps, Hugo
In Section
Seekers of Perl Wisdom
|
|