I have a name which I'd like to give to a variable, in another string variable:
my $name = '$a';
or simply my $name = 'a';
How to make the variable and to use it? I mean something like this (but it doesn't work):
my $name = '$a';
my {$name} = 1; # Doesn't work
say $a; # should be 1
A more general case. I have a list of variable names, say my @names = '$aa' ... '$cc';
How to declare and use the variable, whose name will be e.g. @names[2]
?