I need to get all the .config file in a given directory and in each of these file I need to search for a specific string and replace with another based on the file.
Perl here is just to modify files... I don't understand why to write it whole in perl if you can do it much simpler like this:
find . -maxdepth 1 -type f -name '*.conf' | \ xargs perl -i.bak -pe 's/localhost/example.com/;'