open(AT_LIST, ">>$at_file") ; # $at_file defined elsewhere foreach $bch (@branch_array) { AT_LIST = qx'AT, $bch' ; #One of many variations i've tried } close(AT_LIST);