I submitted this question a few days back and got some responses, but I'm still getting what I need. If I have $command below, I need to swap all ${XYZ}'s in the string w/ their corresponding value in $dynamic_vars{xyz}. I broke this up into two steps, because I first need to make all XYZ's lowercase and then secondly swap ${XYZ} for $dynamic_variables{xyz}.
$command = 'Do this ${command} to ${computer}';
$command =~ s[
\$
{
([^}]+)
}
]
[
$
{
\l$1
}
];
$command =~ [same as above][$dynamic_vars{$1}];
|