in reply to Turn relative url's to absolute with URI
Your code doesn't seem to do what you want it to do...
This begs for a map, as seen in this untested code:
my @newlinks = map { URI->new_abs( $_, $base_url ) } @links; [download]