i'm facing a Problem and i'm not able to google the answer. The Problem is that i'm even not sure about what to search..
Let me try to explain. I've a variable which contains another variable which value changes after it has been stored in the second variable.
E.g.The expected output ismy $a = ''; my $str = "Hello ".$a; $a = 'Kevin'; print $str;
Hello Kevin
I'm not sure how to achieve this.
Thank you in advance.
### EDIT ####It is only about readability.
I've created a Perl Package which delivers all default values for the Program context
Some of these values are relaing on variables which will be updated during runtime.
Like my $executable = "$homedir/bin/abc"; And $homedir will be found within the perl Code.Of course i could move this variable into a subroutine and read it once $homedir has been set.
But in the same context there are variables which have been changed and i don't won't to overwrite them again.
The only solution i can think of is to split the static variables and the dynamic ones into different subroutines.
I thought there might be an option to evaluate the variable value when accessing it for the first time.
In reply to Evaluate variable while using by chickenman
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |