in reply to Re^2: Parse a file and store it in hash of hashes
in thread Parse a file and store it in hash of hashes

I find this highly unlikely. When I run your code, I get the following output:

Global symbol "$rec" requires explicit package name at q:\tmp.pl line +12. Global symbol "$rec" requires explicit package name at q:\tmp.pl line +15. Execution of q:\tmp.pl aborted due to compilation errors.

If I declare $rec as lexical variable and create an empty filename tester.txt, I get no output. This is because you're not using Data::Dumper properly

print Dumper %HoH; # should be print Dumper \%HoH;

Please post the actual code you are using.

Also, look at Config::IniFiles, which does all of what you're doing already.

Replies are listed 'Best First'.
Re^4: Parse a file and store it in hash of hashes
by Sonali (Novice) on Jan 16, 2017 at 10:07 UTC

    That $rec was a typo. I have edited the code again. After I tried using Data::Dumper as you said I am getting the following output. I want to solve the problem using the HoH approach only so I have not used Config::Inifiles.

    $var1 = {};