Is there maybe a faster way to do this task?
Probably, but that depends on precisely the problem at hand. eg. every field in the example given is the same length - coincidence, or is that really a feature of the dataset? Such details can be very important.
Another question is: does it matter if there's a faster way? Everybody likes their code to run faster but if a solution you come up with completes in a short enough time is there any reason to look for something faster, other than purely for the knowledge? It's an admirable trait but you can fall into the trap of over-analysing things when almost any approach might be fast enough.
As you are new to Perl, I would advise you to try the approach which you have suggested (which sounds fine, by the way), see if you can code it up and then see how fast it runs. If you have 2 files with maybe 100k records in each it should run plenty fast enough (a few seconds at the very most on modern hardware) - if it takes longer than that then by all means come back, show your code and ask for more specific help.
Good luck with your task.
🦛
In reply to Re: Find common substrings
by hippo
in thread Find common substrings
by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |