in reply to parsing custom attributes in span/div tags
use Web::Query 'wq'; wq('<html><div cid="some data" url="some url">....</div>') ->find('*[cid]') ->text # '....' [download]