Z
ZZT
Hello friends of perl,
have a problem and hope you can help me
okay, I have an ini-file looks like this:
------------------------------------------------------------------
[def] # name of section is completly unknown
var1=value1
var2=value2
[ref]
var1=value3
var2=value4
---------------------------------------------------------------
#in result I create an array for the section names
@sections=("def","ref");
#while $sections[1] then eq to "ref" for instance
# following variables should then be defined
$def.var1=value1;
$def.var2=value2;
$ref.var1=value3;
$ref.var2=value4;
#then I'd like to apply several routines with the help of this variables
foreach (@sections)
{
function1 ($$_.var1); # -> function1($def.var1);
# ...
}
How can I do this?
Thanks for your answers
bye
have a problem and hope you can help me
okay, I have an ini-file looks like this:
------------------------------------------------------------------
[def] # name of section is completly unknown
var1=value1
var2=value2
[ref]
var1=value3
var2=value4
---------------------------------------------------------------
#in result I create an array for the section names
@sections=("def","ref");
#while $sections[1] then eq to "ref" for instance
# following variables should then be defined
$def.var1=value1;
$def.var2=value2;
$ref.var1=value3;
$ref.var2=value4;
#then I'd like to apply several routines with the help of this variables
foreach (@sections)
{
function1 ($$_.var1); # -> function1($def.var1);
# ...
}
How can I do this?
Thanks for your answers
bye