-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hello all.

I'm trying to interpolate a hash value in a string but i got stuck.
I already tried with eval, without any success... 


I have two conf files in the form
conf file 1:
option=value
option2=value2

conf file 2:
property=propertyValue
property2=propertyValue2

I'm loading these files into a hash. But the problem is that i want to
access, for example on conf file 2, properties from conf file 1:

property3=$HASH{option2}


So i'm getting the hash for conf file 2:

%PROPERTIES=(property=>"propertyValue",  property2=> "propertyValue2",
property3=> "$HASH{option2}" );

but what i want is:
%PROPERTIES=(property=>"propertyValue",  property2=> "propertyValue2",
property3=> "value2" );


this is how i'm reading the files:

sub _read_conf_file{
  open my $FH, '<', shift @_;
  while(<$FH>){
    chomp;
    s/\#.*//;
    /(\S+)\s*=\s*(.+)/;
    next if (!defined $1 || !defined $2);
    $OPTS{$1}=$2;
  }
  close $FH;
}

Does anybody knows how to do this?

Best regards,
David Santiago

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2

iQEbBAEBCAAGBQJWOS8dAAoJEJ/OLjwuDYzKFHUH9jIdB/XtN/ub0mJFCNFPdvVt
JVQnFKHpbzoWpiPXbsxuGTYRDg3QFZnyqqBgrkB+yJ82IK3Uc/aDxvr1dSog6jdP
59okJgbmvqMLvH9d8B7bWQLAoKZCQvQKRgeeZuSxuE7v7y8gIKvFUvYcR7vqUBau
zlcG20mE6zhKO6rBsJsb3blFPtYuf/FewzRwvKRkD8NHGLuPmrzXFepkYnynJz+k
/BhejiiJN4GMlbjLPlYIOrLKlCCKVrOx7XeUB13lnsHZ1jvMimtu4T9wxWRGfqaf
pJJrQA7weEJz/jLBAuEbRbsqhskHJGBfARxhQ3Ba4M410cQyVsmuVxjz6JOrlA==
=hl/V
-----END PGP SIGNATURE-----

Reply via email to