system('/usr/bin/scp', "user\@$i:/tmp/zz.txt", "/tmp/zz_$i\.txt"); /tmp/zz_$i.txt becomes /tmp/zz_$i?.txt where $i is a hostname.