|
|
| go ahead... be a heretic | |
| PerlMonks |
Longest Matching URLby marceus (Initiate) |
| on Mar 20, 2002 at 12:05 UTC ( [id://153027]=perlquestion: print w/replies, xml ) | Need Help?? |
This is an archived low-energy page for bots and other anonmyous visitors. Please sign up if you are a human and want to interact.marceus has asked for the wisdom of the Perl Monks concerning the following question: Given an unsorted list of URLs (ie from a DBI query) and a target URL to match ... I need to find the longest Matching URL in the unsorted list ... and the portion of the Target URL that isn't matched. For example if the list contains:
and the target is:
it should return:
I have the following code (generalized for this post): The code did come at a point where I was just beginning to write perl after a long haitus so I apologize for the "unique" style. This code has been one of the buggiest least robust parts of the entire project. So I am here asking if this is the best way? Is there a better Algorithm/Solution? Is the code just riddled with bugs?
Back to
Seekers of Perl Wisdom
|
|
||||||||||||||||||||||||||||||||