I have a program that has a number of filenames configured internally. The program edits a bunch of configuration files associated with a database account, and then changes
The recent versions of File::Slurp provide convenient functions, edit_file and edit_file_lines. The inner part of your code would look:
edit_file
edit_file_lines
use File::Slurp qw(edit_file); edit_file { s/$oldPass/$newPass/g } $filename;