Product1 property=value property2=value Product2 feature1 property=value property2=value feature2 property3=value Product3 feature1 property=value property2=value #### @file = ; foreach(@file){ if (/^TSS/){ # All product begin with TSS # Its a product }elseif ($_ =~ /=/){ # get the property and value using split }else{ # Its a feature??? } } # Should I use something like: $hash{$product}{$feature}{$property} = "value"; # or $hash{$product}{$property} = "value"; $hash{$product}{feature} = "feature name"; # if the feature key is here, there is a feature. # but how do I keep properties listed after the correct feature!