in reply to multiple matches per line *AND* multiple capture groups per match
In the assignment
(@complete_url, @filename) = ($_ =~ /$test_regexp/g)
all matches will be assigned to the array @complete_url. I would expect that you find the urls and filenames both in the array. So you have everything in one array and need to split it into two afterwards.
In Section
Seekers of Perl Wisdom