in reply to Creating a new variable named the contents of another
Consider using a simple %hash with the names as hash keys:
Setting the values:
$hash{ name } = "value"; # or
$hash{ $name } = $value;
Returning a single value from a subroutine:
return $hash{ $name };
Saves you trouble.
Cheers, Sören
Edit: "Returning a..." and some more comments.
|
|---|