in reply to Re^2: elegant way of handling hash?
in thread elegant way of handling hash?
You can do the first two quite easily
@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();
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^4: elegant way of handling hash?
by Roy Johnson (Monsignor) on Jan 19, 2006 at 15:32 UTC |