in reply to Changing the name of a variable in perl , with perl.
But you can manipulate the symbol-table to create new variables like this:
Note that this only works for variables that live in the symbol-table ("our"-variables) and not for lexicals (varibles introduced with "my").no strict "vars"; our $hubba = "whatever"; # create a new variable $bubba and make it an alias for $hubba *{$::{"bubba"}} = \$hubba; print $bubba; # prints "whatever"
|
|---|