|Pathologically Eclectic Rubbish Lister|
Reading from an INI fileby MrCromeDome (Deacon)
|on May 15, 2001 at 18:37 UTC||Need Help??|
MrCromeDome has asked for the wisdom of the Perl Monks concerning the following question:
I have a Perl script that is being deployed at several different sites. To allow each site to customize the appearance of the HTML generated, I have an INI file with a number of NAME=VALUE pairs. What I'm wondering is if there is a way to assign a value to a variable name that is stored in a variable. For example, if I have the following in my INI file:
I'd like to be able to read $NAME into $var1 and John Smith into $var2, and then assign what's in $var2 to the variable name stored in $var1.
I can currently work around this. Here is my script thus far:
Can I use a hash to accomplish what I described above? I'm sorry for sounding ignorant, but I'm still new to Perl.