for my $i ( 0 .. $#array1 ) { 0 == system 'curl', '-G', '-x', "$array1[$i]:$array2[$i]", 'http://www.google.com' or die "system 'curl' failed: $?"; }