To get rid of too many variables I used hash to record all my records in it,
sub initilize_config
{
my ($HR_config,$file) = @_;
open (my $fr, '<', "$file") || die "Unable to open configuration f
+ile: $file $!";
while (my $line = <$fr>)
{
$line =~ tr/\r\n//d;
next unless $line;
if ($line =~ /=/)
{
my ($key,$val)=$line=~ /^(.*?)=(.*?)$/;
$$HR_config{$key} = $val;
}
}
}
the key of the hash is constant where as value always change so in some subroutine if I want to extract and use the value of some key, suppose "xyz".
How can that be done?
Can any one suggest me please!!!
Cheers