No such thing as a small change | |
PerlMonks |
comment on |
( [id://3333]=superdoc: print w/replies, xml ) | Need Help?? |
As others have said, what you are trying to do can be done by config files, a simple regex or templates. There is no need to re-invent the wheel or make it square. Another way is to control your deployment script with command line parameters: deploy.pl --script-name abc --location xyz/abc etc. And then there are ... autotools (written in Perl I think) which can do variable substitutions to source file templates. I would not use it just for a small task. I am mentioning it because you may want to use it as your main deployment/installation framework and be able to do ./configure && make all && make container && make backup && make push-git. It requires a lot of work to get started with it. Does your use-case justify it? Here is a skeleton just for the var-sub part (ripped from various sources on the net):
Edit (forgot the perl script to have vars substituted): Edit2 (the name ends in .in denoting a template input, the .pl file will be produced from that. During the configure stage, not the make.):
bootstrap it using (just once): aclocal && automake --gnu --add-missing && autoconfand then: ./configure <params> && make allWhen IT people hear autotools, they will almost certainly parrot cmake, gradlew, maven as in a monty pythons sketch. Alas they are serious. Only a true hacker's heart fills with adrenaline when finally reached the state of ./configure && make all. But can you handle it? bw, bliako In reply to Re: Prepocessing perl code / substing variables (kraken released!)
by bliako
|
|