in reply to Counting links in a file?

Check HTML::LinkExtor.