#!/usr/bin/env perl use strict; use warnings; use feature 'say'; my $infile = shift; open my $in, '<', $infile or die "Cannot open $infile: $!"; while (<$in>) { chomp; s/=\s*$/"= " . shift/e; say; } close $in; #### $ ./bar.pl template.config list.txt file_list.txt ;; path to config file $;INPUT_FILE$; = list.txt ;; path to list of config files $;INPUT_FILE_LIST$; = file_list.txt ;; path to temporary directory $;TEMP_DIR$; = $;TMP_DIR$; ;; use --v for verbose summary $;OTHER_ARGS$; = --v #### ;; path to config file $;INPUT_FILE$; = ;; path to list of config files $;INPUT_FILE_LIST$; = ;; path to temporary directory $;TEMP_DIR$; = $;TMP_DIR$; ;; use --v for verbose summary $;OTHER_ARGS$; = --v