$hash{$col1}{"$col2_"."$col3"} = "col4\tcol5" #### if (exists $hash{$col1}){ if (){ ## Dont know what I should fill here to check the values of col2 and col3 in a particular range } }