substitute{SUBSTITUTIONS}[{OPTIONS}]@FILES
Takes a hash reference with substitutions key value pairs, an optional hash reference with options and a
list of files to deal with.
Options
Several options are available:
sufix
Sufix for source files, for example you can use sufix ".in" and results of processing of Makefile.in
would be written into file Makefile. Note that you don't need to specify sufixes in the list of files.
from
Source base dir. By default it's the current working directory (Cwd). All files in the list are
treated as relative to this directory.
to Destination base dir. By default it's the current working directory (Cwd).
Fileformat
In the files the following constructs are replaced:
###\s*after:\s?some string with @KEY@
some string with @KEY@
some string with value
###\s*before:\s?some string with @KEY@
###\s*replace:\s?some string with @KEY@
So string should start with three # characters followed by optional spaces, action keyword and some
string where @SOME_KEY@ are substituted.
This module can replace lines after or before above constructs based on action keyword to allow you to
change files in place without moving them around and to make it possible to run substitution multiple
times.