$ perl -E ' my @lives = (1, 2, 3); my $url_base = "https://v3.football.api-sports.io/fixtures?live="; for my $live (@lives) { my $url = "$url_base$live"; say "Do stuff with $url"; } ' Do stuff with https://v3.football.api-sports.io/fixtures?live=1 Do stuff with https://v3.football.api-sports.io/fixtures?live=2 Do stuff with https://v3.football.api-sports.io/fixtures?live=3