Problems? Is your data what you think it is? | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
The module suggested by AppleFritter is certainly the easiest way.
But in case you want to do it yourself in pure Perl without using a module, the most idiomatic way to do it is probably to use a hash (or two hashes in this case). This command-line script (re-using AppleFritter sample data) should give you a gist on how to do it: Please ask if there is something you don't understand. Edit: I had not seen j0se's solution when I suggested mine. Although the two solutions look very different, they are based on exactly the same ideas. I probably would not have posted anything if I had seen j0se's post before. Now it is done, I leave the post, it shows at least that, really, TIMTOWTDI in Perl. (BTW, j0se, I have spent at least 18 weeks in your country, specifically in Bratislava, working for Orange Slovakia back in 2008 (preparing the Euro transition), and also 6 or 7 more weeks a few years before. And, long before, I also visited Bratislava as a young tourist back in 1975, in a totally different and quite difficult political context. Nice city and very nice people. Sorry for the off-topic digression.) In reply to Re: Comparing 2 hash tables where values are stored in arrays
by Laurent_R
|
|