I don't think this is the right approach to the problem. We should first design the interface that config.status needs (mostly s/@foo@/val/), and implement a tool that does this with existing tools.
You would give the list of substitution to perform, and then the tool would make them. This would allow using Perl, etc.
