It uses a suffix tree to find the substrings, so it should be fairly efficient. Out-of-the-box, it finds substrings of length >=4, but that could probably be changed. Substrings of length one would not be compressed, anyway.
Update: You might prefer Algorithm::Diff, which has a nicer interface and more options.
Update2: The node Re: finding longest common substring also builds a suffix tree and it might be adaptable to your problem.
In reply to Re: Imploding URLs
by tall_man
in thread Imploding URLs
by mobiGeek
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |