Good day,
is there any way to store the name of a constant (not the value) in a variable and access the value of this constant through the variable?
For example, if I had a constant named FOO.
I know, it would work if I'd just remove the quotes, but I just get the name of the constant from a function, not the value.
Hope you can understand me. And thanks in advance.
is there any way to store the name of a constant (not the value) in a variable and access the value of this constant through the variable?
For example, if I had a constant named FOO.
Code:
my $var = 'FOO'; # FOO contains "bar"
print $var; # should print "bar", prints "FOO"
I know, it would work if I'd just remove the quotes, but I just get the name of the constant from a function, not the value.
Hope you can understand me. And thanks in advance.