in reply to Getting only the link in a line

You might also look at URI::Find and friends.