I dont know Perl so I can't write this script in Perl right now. This is in python and it should be pretty straight forward what happens here. If you know Perl I'm positive you can translate this script to Perl. I hope you appreciate the effort.
This script first searches for all the links, then for each link it searches for the guid and part of the tag content.
import re
sample_str = """
<a href='/mysite/test/sample2/_layouts/ListEdit.aspx?List={2A1D7816-6AC1-4B3B-B9E9-9EEF1B31F812}' onclick='GoToLink(this);return false;'>Customize "Sample List"</a>
bla bla
<a href='/mysite/test/sample2/_layouts/ListEdit.aspx?List={21M31F46-937B-88B3-U7Z1-99DFJZ9N249A}' onclick='GoToLink(this);return false;'>Another "This is it"</a>
"""
links = re.findall('<a .*?</a>', sample_str)
for link in links:
print 'link:'
print ' ' + link
print 'list:'
print ' ' + re.search('List={([^}]*)}', link).group(1)
print 'quoted text:'
print ' ' + re.search('>[^<]*"([^<]+)"[^<]*</a>', link).group(1)
print ''
The output for this script will be:
link:
<a href='/mysite/test/sample2/_layouts/ListEdit.aspx?List={2A1D7816-6AC1-4B3B-B9E9-9EEF1B31F812}' onclick='GoToLink(this);return false;'>Customize "Sample List"</a>
list:
2A1D7816-6AC1-4B3B-B9E9-9EEF1B31F812
quoted text:
Sample List
link:
<a href='/mysite/test/sample2/_layouts/ListEdit.aspx?List={21M31F46-937B-88B3-U7Z1-99DFJZ9N249A}' onclick='GoToLink(this);return false;'>Another "This is it"</a>
list:
21M31F46-937B-88B3-U7Z1-99DFJZ9N249A
quoted text:
This is it
If you have python you can easily run the script with python scriptname.py
on the command line.