I know you are hoping that we might just write the whole thing for you, but you should at least show some effort. Meet us part way by showing a first attempt at solving the problem with comments indicating where you can't figure stuff out.
A few hints are in order:
- Read each file once into a suitable data structure. For the config file that might just be a string. For the game list it's probably an array.
- Iterate over the items in the game list and generate the output files.
- Take your own advice for updating the config template to generate the named output config file.
- Always use strictures (use strict; use warnings; - see The strictures, according to Seuss).
Optimising for fewest key strokes only makes sense transmitting to Pluto or beyond