in reply to Getting URL info

Please use one of the many HTML parsing modules from CPAN. There is even one whose main purpose is specifically what you want to do. (It has something like 'Linkextractor' in the name).

Abigail