in reply to Re: How to I retrieve a specific key/value from a hash?
in thread How to I retrieve a specific key/value from a hash?
Probably run faster and be easier to maintain that way, too. If you need more variables, use a hash:$graphic1 = $pers_dcr_files{ $key[1] }{GraphicName}; $graphic2 = $pers_dcr_files{ $key[2] }{GraphicName};
You have to reference it as $graphic{1} instead of $graphic1, but that doesn't seem like a real big problem.for $i (1..10) { $graphic{$i} = $pers_dcr_files{ $key[$i] }{GraphicName}; }
|
|---|