Software >> Development >> Languages >> Perl >> RegExp >> How to add URL base to a relative URL in HTML anchor tag

assuming $html contains the html page, and $baseurl contains url base $html =~ s/<a href=[\"]*\/([^\"]*)[\"]*([^>]*)>/<a href=\"http:\/\/$baseurl\/\" >\n/gi