M
Marten Lehmann
Hello,
I'm using "use strict" in the beginning of every script, but for one
certain case, I want to access variables by their names like this:
foreach $type ("billing", "admin", "tech") {
print ${$type};
}
The value shall be the same is if I would call $billing, $admin or
$tech. I can assure that these three variables exist in my script and
although I could maybe rewrite parts if the script to put the values in
a hash, I really would like to know how can I access them without a
hash. Any ideas?
Regards
Marten
I'm using "use strict" in the beginning of every script, but for one
certain case, I want to access variables by their names like this:
foreach $type ("billing", "admin", "tech") {
print ${$type};
}
The value shall be the same is if I would call $billing, $admin or
$tech. I can assure that these three variables exist in my script and
although I could maybe rewrite parts if the script to put the values in
a hash, I really would like to know how can I access them without a
hash. Any ideas?
Regards
Marten