( (SECTION (Section_KEY Value1) (Another_KEY1 Value2) (KEY2 value3) (KEY3 Value4)) (NEW_SECTION (SUB_SECTION (KEY4 Value5)) (NEW_SUB_SECTION (KEY5 Value6) ) ) ) #### open ( BRD, ") { my $new_line = $_; chomp; // magic happens here where a has get filled in like this $DATA_HASH{SECTION}{Section_KEY} = Value1; $DATA_HASH{SECTION}{Another_KEY1} = Value2; $DATA_HASH{SECTION}{KEY2} = Value3; $DATA_HASH{SECTION}{KEY3} = Value4; $DATA_HASH{NEW_SECTION}{SUB_SECTION}{KEY4} = Value5; $DATA_HASH{NEW_SECTION}{NEW_SUB_SECTION}{KEY5} = Value6;