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