You can use HTML::SimpleLinkExtor under the same terms as Perl itself.