@replacehash{ map{ "TEMP$_" } 1 .. 2 } =
map{ $flow->$_ } qw[getExeName getTempName];
Doing the third one, with the double level of indirection, would probably require a string eval.
Whether you should do this is another matter entirely. It would have to be a pretty long list to warrent it, and even then you would probably be better having the $flow class provide an API that returned the hash. That way the construction need only be done once and the user of the $flow object can just do
my %replacehash = $flow->getAll();
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
|