How can I efficiently group a large list of URLs by their host name in Perl?
- by jesper
I have text file that contains over one million URLs. I have to process this file in order to assign URLs to groups, based on host address:
{
'http://www.ex1.com' = ['http://www.ex1.com/...', 'http://www.ex1.com/...', ...],
'http://www.ex2.com' = ['http://www.ex2.com/...', 'http://www.ex2.com/...', ...]
}
My current basic solution takes…